Detail tables failing to update in 1517

Well I need the where clause on the master table if I don’t want to load all master records in the database.

Whilst, with the moAllInOneFetch option enabled, the regular Open function does work as you say, this retrieves all database records at all levels which is just what I wanted to avoid.

I’m happy all this is working correctly now but it basically boils down to two things:

  • Add the moAllInOneFetch option to MasterOptions in all tables
  • Add Dynamic Where clauses to each table to pre-filter the records you wish to retrieve (unless you want all of them)

Hi,

Initial dynamic where will filter records

By initial do you mean the where on the top-level Master table?

If I only apply this then it will load all records in the detail tables rather than only those pertaining to the required master record.

Hi,

I don’t know all details of your project.

in some cases, it may have a sense to use mmParams instead of mmWhere with SQL in details tables like

... 
WHERE (master = :masterID) and {WHERE}

it will work similar to your DynamicWhere expressions:

      with tblDetail.DynamicWhere do Expression := NewBinaryExpression('Detail','MasterId',dboEqual,1);
      with tblSubDetail.DynamicWhere do Expression := NewBinaryExpression('SubDetail','MasterId',dboEqual,1);

but this filter will be always applied

Ok thanks. Basically I’m happy with the solution I have now as it not only works as before but I think it’s more “correct” than fiddling with disabling RemoteFetchEnabled as I did previously and which ultimately bit me on the backside :slight_smile:

Thanks for your help.

1 Like