Group Level Example (Magic xpa 4.x)
In a Batch task that prints running totals from an Order Lines tables sorted by Customer (high), Order Number (intermediate), and Item Number (low), the lowest Group level is based on changes in the Item Number, the second Group level is based on changes in the Order Number, and the third Group level is based on changes in the Customer Number.
During processing of the first record, the Group Prefixes of all levels are executed, from the highest to the lowest. When the first item in the first customer’s first order has been processed (for example, counted or printed), the Suffix of Item Number (the first Group level) is executed.
After all the first order’s item lines have been processed, the Suffix of the intermediate Group level, by order number, is executed, to print the total values for the first order. Group levels for both Item Number and Order Number are executed for all this customer’s orders, and then the Group Prefix for the next customer is executed.
If, during the scanning of the record, a higher-level Group field changes value, all the Group Suffixes up to that level will be executed before the next record is processed.
After all of the records are processed the Task Suffix executes. In this example the total values for all customers will be printed.
How Magic xpa Executes Group Levels
Batch Task Event Handling