Record Level (Magic xpa 3.x)
In the Record level you can select either Prefix or Suffix.
In the Record Prefix logic unit, place the operations that the engine executes for every record immediately after the record is read from the data source and before interaction starts (before the end user has access to the task form). The Record Prefix logic unit stores operations that are used at the initialization stage of a record: procedural operations that need to be carried out on the record before the beginning of processing its parameters.
The Record Loop
The engine executes the following steps once for every record the end user browses in Online and Browser tasks, and once for every record in the data view, starting from the first record, in a Batch task:
-
The first record in the data view is located and fetched.
Note: In Online tasks, if no record is found, the task will be opened in Create mode. This only happens if the Allow Create property in the Task Properties is set to Yes; otherwise, the task execution is terminated.
-
The Init expression is evaluated for all of the Virtual variables. The Init expressions for columns are evaluated only if the task is in Create mode.
-
All of the links to data sources are executed for the current record.
-
If the Evaluate condition option in the Task Properties is set to Before entering record, Magic xpa evaluates the End Task condition.
-
The Record Loop begins here. Therefore, from here on you can manipulate data source columns.
-
The Record Prefix logic unit operations are executed.
The Record Suffix logic unit is executed after the end user commits the record and before the record is written back to the data source.
In the Record Suffix logic unit, place the operations that the engine executes:
-
For each record of the data view in Batch tasks.
-
For each record browsed and modified in Online, Rich Client, or Browser tasks. This means that if the record was not changed, the Record Suffix operations will not be executed.
Record Termination Level
The engine executes the following steps once for every record the end user browses in Online and Browser tasks, and once for every record in the data view, starting from the first record, in a Batch task:
-
Execute Record Suffix operations.
If this is a Batch or non-interactive Rich Client task, execute all the operations in the Record Suffix operations. A record is always saved to the database, even if it was not changed.
If this is an Online, interactive Rich Client or Browser task, execute the Record Suffix logic unit only if the current logical record has been changed.
You can force this mode by using the Force Record Suffix property.
Magic xpa considers the current record to be changed if any of the following happened:
-
The task execution is terminated, such as a result of end-user interaction or if an End Task condition evaluates to True.
-
The Selection Table property is set to Yes and the end user pressed Enter.
-
The Force Record Suffix property is set to Yes.
-
Performs record deletion when required.
-
Evaluate the End Task expression if the Evaluate Condition task property is set to After Updating Record.