VERSIONS: All
SUBJECT: Master->Detail without links in DataModel
BY: BILL TODD
If you want to create a master-detail form without linking the tables in the datamodel, here's a short description
When you get an action DataArriveRecord event for the master call setRange() for the detail to show only the records for the current
master.
- For the master trap the DataArriveRecord event and do a setRange on the detail to show only the detail records that belong to the current
master. Where you do this depends on whether the master is displayed in single fields, a tableframe or an MRO. If a tableframe or MRO put the
code in the tableframe or MRO's action method. If you are using single fields then put the code in the form's action method and check the active
object's tablename property to see if the target of the action is the master table or one of the details.
- Add code to the detail tableframe or MRO's action method to copy the key from the master to the detail on an action DataInsertRecord. Don't
forget to do a doDefault to create the new record before you assign values to its key fields.