getCurrentCycle( )

Retrieve the current cycle instance number.

Syntax

getCurrentCycle()

Parameters

None.

Return value

Number that indicates the cycle intsnace number:
  • A positive number refers to the current cycle instance number.
  • -1 if the target form is not on a cycle visit.

Examples

Example 3-98 If the current cycle instance is even (2, 4, 6, and so on), set the value of the dynamic form launch item to true

// get current cycle instance number
var currCycle = getCurrentCycle();
 
// if cycle instance is even, set value to true
if (currCycle > 1 && currCycle % 2 == 0) {
  return setChoiceLabel("TRUE");
} else {
  return setChoiceLabel("FALSE");
}