How Do I Execute the Task Prefix/Suffix Logic of a Subform Whenever the User Enters the Subform? (Magic xpa 4.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 entered by a user action, such as tabbing into the subform or clicking on it, then SubformExecMode(0) will return 0. So using
SubformExecMode(0) = 0
as the condition on the block will cause the block to only execute when the user enters the subform.
-
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)=0
-
Press Enter to select the expression and bring back the expression number.
Now the block will only execute if the user enters the subform.
The Online Samples project (program SB08)