This presentation shows how to develop a Master-Detail form. Such a form has a One-Many type of relationship. The “one” is the master and the “many” is the detail. This examples deals with a Customer-Invoice form. Customer is the Master. Invoice is the Detail.
A new module
A new customer form will be created
Notice the name of the data block
The data block used
The prompts have been changed
Notice the name of the Frame Title Only one record will be displayed
Notice the Frame Title here
Notice the Frame Title again A single record is displayed
The data block
The module has now been named CUSTOMER_1_TO_M. This is done in the property palette.
Ensure that the CUSTOMER_1_TO_M module is highlighted
A new data block for INVOICE will be created
Choose the INVOICE table
Select all items
Un-tick the auto-join box
Click Create Relationship
The two tables have to be joined
INVOICE will be joined with the MY_CUSTOMERS data block
The two tables have to be joined on CustomerNumber. The Detail Item needs to show CustomerNumber
Choose CustomerNumber from the Detail Item pull- down menu.
Choose CustomerNumber from the Master Item pull-down menu.
Notice the join condition
Name the data block INVOICE
Now the layout of the form needs to be created
Choose the same canvas
All invoice items are needed
Rename the prompts
Choose the tabular format
Give the Frame Title the name Invoice Detail. Allow 5 records to be displayed. Display a scrollbar.
Notice the 1:M relationship is shown with a maximum of 5 records on the many side. The scrollbar can be used to show more records
Customer 5155 has no invoices
Customer 5204 has 3 invoices