How Do I Execute Task Prefix/Suffix Logic of a Subform Whenever the Subform Is Refreshed? (Magic xpa 3.x)
Task prefix executes whenever a task starts, and task suffix executes whenever the task ends. However, in a subform, you can have a Block operation within the task logic unit that executes depending on how the subform was entered. This is done using the SubformExecMode() function.
If the subform task was executed during a refresh operation, such as an automatic refresh or a manual SubformRefresh action, then SubformExecMode(0) will return 2. So using
SubformExecMode(0) = 2
as the condition on the block will cause the block to only execute when the subform is refreshed.
-
Open up a line in the logic unit you are modifying (F4 or Edit->Create Line).
-
Select the Block operation by typing B or by using the pulldown list.
-
Two lines will open up, a Block If and a Block End. Tab to or click on the field after the If.
-
Zoom (F5, double click) to the expression rules. Enter the expression:
SubformExecMode(0)=2
-
Press Enter to select the expression and bring back the expression number.
Now the block will only execute when the subform is refreshed.
The Online Samples project (program SB09)