Salesforce

Referring to the Triggering Object (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Referring to the Triggering Object (Magic xpa 3.x)

Although logic units, and tasks called from the logic units can query the entire runtime tree, you might want to query the object that triggered the event. The object from which an event is triggered can be a variable, control, or task. The ability to refer to the triggering object is necessary for global handlers that need to handle the exact object from which the event was triggered.

This() Function

The This() function is a simple function used to refer to the triggering object. The triggering object can be the triggering task or the triggering variable. This function is used instead of the variable index in the variable-related functions and instead of the generation in generation-related functions.

The This() function requires no arguments and cannot be used in complex expressions, such as This()+1.

The Triggering Variable

The triggering variable is the variable on which the task is parked when an event is triggered. You can refer to the triggering variable using the various variable-related functions where the This() function is used as the variable index. For example, to get the attribute of the triggering variable you would use the expression: VarAttr(This()).

The Triggering Task

The triggering task is the task from which an event is triggered. You can refer to the triggering task using the various generation-related functions where the This() function is used as the task generation. For example, to get the level of the triggering task you would use the expression: Level(This()).

Handled Control

You can also refer to the handled control from which an event was raised. This is usually used in mouse-related events, such as Click, DblClick, MouseOver, and MouseOut. You retrieve the handled control by its name using the HandledCtrl() function. This function requires no arguments.

Reference
Attachment 
Attachment