Home > For Designers > Design Patterns > Report on a Computed Form Field

Report on a Computed Form Field

Goal 

When you add a Child Data List field to a form, you can do automatic computations on the items entered. For example, in an automobile claim, you display the sum of the amounts for each claim item. But when you run a report on Claims, that value is not available for reporting. The goal is make the value available, without having to run a report on each claim-item record in the system.

 

Solution

The solution is create a Rollup field in the Claim data. The value in that field is updated when changes to the stream record are saved, so it always reflects the final computation.

 

Background

The computed value displayed in the form (sum, average, max, min, or count) is computed as the form is filled out, and does not always need to be saved. For example, the form might display a count of records that have been entered to help the user make sure that nothing was overlooked. That value wouldn't need to be stored in the record, but is helpful to have on hand when entering the data.

 

The value in the Rollup field, on the other hand, is stored in the stream record, and is updated whenever changes are submitted. In the interests of performance, the value is updated only when the changes are submitted. So if someone is editing a record while a report is being run, it is possible for there to be a discrepancy. (But that situation is rare, and relatively minor.)