list2SInstances( )
List all instance numbers for a two-section form.
Note:
This is an aggregation function. The rule is run for each form instance in the case where the target is on a two-section form.
Syntax
list2SInstances('variable', formInstance, includeDeleted)
Parameters
- variable
-
An item that exists on the visit or form to search.
Note:
It is allowed to reuse variables passed into this function elsewhere in the rule expression, however you must add the variable as a parameter using single quotes. - FormInstance
-
- If null, the search considers an array of existing instances of two-section forms. Ideally this should be used with variables in the flat section of the form.
- If a value is provided, the search considers an array of existing table rows on the specified instance of the two-section form.
- includeDeleted
-
- null or 0 - Do not include deleted two-section instances in the return array.
- 1 - Include deleted two-section instances in the array count.
Return value
An array of two-section form instance numbers.
Example 3-74 Raise a query if AE form instance #2 does not exist
// Raise a query if AE form instance #2 does not exist
var arrAE = list2SInstances('onDate', 0);
return (arrAE.indexOf(2) == -1)?false:true;
Parent topic: Two-section form functions