Creating a report to process data
Reports are very useful for performing an operation on multiple records. Here we will see how to build a report to process changes to data.
How to do it...
Create a new blank report from Object Designer.
Set the following property on the report:
Property
Value
ProcessingOnly
Yes
Add a data item for the Customer table.
In the
OnAfterGetRecord
trigger for the customer data item add the following code:"Last Date Modified" := TODAY; MODIFY;
Save and close the report.
How it works...
A Data Item is a record variable. However, instead of us writing our own code to loop through each record, this functionality is built into a report. That makes a report a great place to perform a mass processing of records. For this type of report we don't want any pages to be displayed. This slows down the processing speed dramatically. To do this we set the ProcessingOnly
property of the report to Yes.
The OnAfterGetRecord
trigger is fired after each record is retrieved from the...