Totalling is a facility for automatically maintaining derived field values. When a field is updated as a result of totalling it will be updated on screen automatically provided that the QA Build compiler can determine the appropriate map and field number to use.
You can total from a source field into a target field using one of three methods:
Update and downdate totalling work appropriately to maintain the total correctly depending on how records are being processed: for example the initial value is always 0 for a new record (so the change is simply the final value), and when a record is deleted update totalling subtracts the initial value from the total rather than adding the changed value.
You may wish to set up local variables for displaying totalling results (such as subtotals). If you use a local field, initialise the value in an earlier procedure before the field is used for totalling.
There are various items that you may specify for the processing of a totalling field:
A condition to total allows you only to perform totalling conditionally. For example, you might wish to total a transaction line value into one of several fields depending on the item sold. You could do this by specifying several parts of totalling for the same source field using mutually exclusive conditions to total
A condition on total is used to check that the target value is within a specified range
If the condition on total is not satisfied, the procedure will abort. Wherever possible, set up validation for the target field in an earlier part of the procedure
This is only used when totalling a field into a target field with more occurrences and is used to specify the occurrence number to start totalling into (usually 1)