Salesforce

How Do I Set Logic to Be Executed According to the Task Type in the Same Handler? (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Set Logic to Be Executed According to the Task Type in the Same Handler? (Magic xpa 4.x)

One of the ways you can save time in programming is to use one Event handler that is called from many different programs. However, the handler may need to work differently depending on the task type from which it was called. For instance, in this example, a message is given to the user if the calling program was an Online program. Otherwise, the error message is written to an error log.

To create this sort of context-sensitive programming, you can use the TaskTypeGet() function to query what kind of task invoked this handler.

The syntax for TaskTypeGet() is:

TaskTypeGet(Generation)

where Generation is a number representing the task’s hierarchic position in the task tree. 0 is the current task, 1 is this task’s parent, and so on.

TaskTypeGet(1) returns the calling task type: O=Online, B=Batch, C=Rich Client, R=Browser client, M=Main Program, MC=Main program from within a Rich Client program.

See also

The Online and Rich Client Samples projects (program LG17 and RLG17)

Reference
Attachment 
Attachment