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)
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);
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