Salesforce

IsFirstRecordCycle (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

IsFirstRecordCycle (Magic xpa 4.x)

Lets you identify the first record cycle in the task. This information is useful for running logic that on the one hand is based on the already-fetched data, after the Task Prefix, and on the other hand for logic that is run only once, on entering the task.

Syntax:

IsFirstRecordCycle(generation)

Parameters:

generation: A number that represents the task's hierarchic position in the runtime task tree. 0 represents the current task, 1 its immediate ancestor, and so on.

Returns:

True when the current record cycle is the first one or when the function is evaluated in the Task Prefix logic unit.

False is returned when the function is evaluated in the Task Suffix or Group level logic units.

When this function is used in a task running in a subform, then:

  • In Online tasks, the function will return True when the subform task gets focus, since the task is re-opened.

  • In Rich Client tasks, the function will return False when the subform task gets focus, since the task is always kept open.

Note:

The various Refresh events like View Refresh, Screen Refresh, Display Refresh, or when Magic xpa refreshes the data view after User Range or User Sort, do not affect this function. When this function returns False, it can return True only by returning to the task.

See also:

How Do I Condition the Logic to Be Executed Only for the First Record in an Online Task?

The Online and Rich Client Samples projects (program LG09 and RLG09)

Reference
Attachment 
Attachment