Order records in the Business Records diagram

When multiple records exist with relations defined, you can specify the order in which the rows are fetched.

Before you begin
You have a Report Data file opened, displaying the Business Records diagram.
Note: At this time, the ordering or records in a Business Record diagram only impacts reports. It will not have any affect when set on business records defined for a form or Web service.
The settings.agconf file must set the orderRecords attribute to true for the Record Data file extension:
<File extension="4rd" orderRecords="true">
This attribute should be set at installation. If this attribute is set, an ordering number appears in the child as soon as a relation is added between two records.
About this task

When you order the records in a diagram, you are defining the order in which the records are fetched. The order is identified by an order indicator, located next to the record name in the diagram.

Example : the master record has ordered children
For example, examine this ordering of records in a Business Record diagram:
Figure: Ordering of records (example 1)

Screenshot of records where three child records of the master have been assigned an order.
The records would be fetched in this order:
  • Record1 (Master)
  • Record3 - all relevant rows are read for Record3 prior to moving on.
  • Record4 - all relevant rows are read for Record4 prior to moving on.
  • Record2 - all relevant rows are read.
To reiterate: ALL rows of the child specified first in the order (Record3 in our example) are fetched before moving to the next child in the order.
Example : the master record has ordered children and grandchildren
In this next example, one of the child records has its own children, and those children also have an order defined:
Figure: Ordering of records (example 2)

Screenshot of records where three child records of the master have been assigned an order, and grandchildren as well.
The records would be fetched in this order:
  • Record1 (Master)
  • Record3 - all relevant rows are read for Record3 prior to moving on.
  • Record4 - With each Record4, the child records are also fetched.
    • Record6 - All relevant rows are fetched prior to moving on.
    • Record5 - All relevant rows are fetched before the next Record4 is fetched.
    All relevant rows are fetched for Record4 (and therefore Record6 and Record5 as well) prior to moving on.
  • Record2 - all relevant rows are fetched.

Steps

  1. Right-click on a record and select Order Records.
    The Edit List dialog displays.
  2. Select a record in the list.
  3. Use the arrows to move the record up or down in the list.
  4. Once you have completed arranging the records in the order in which they should be fetched, click OK.
    The dialog closes. The order indicators are updated to match the new order.