Salesforce

DataViewVarsIndex (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

DataViewVarsIndex (Magic xpa 3.x)

Returns the variables' indexes.

Syntax:

DataViewVarsIndex (generation, option)

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.

option – A numeric value defining the scope of variables to be fetched. The following values are valid:

  • 0 – Entire data view for the task

  • 1 – All form variables

  • 2 – Displayed form variables. In this case, only the variables that are visible will be displayed.

  • 3 – Displayed table variables. In this case, only the variables that are visible and attached to a visible column in a table will be displayed. (Since version: 3.2a)

Returns:

A vector containing the indexes of the variables.

If the Option parameter is not 0, the order that the variables will appear in the vector will be the order that they are displayed on the screen. If the Option parameter is 0, the order that the variables will appear will be according to the task data view. Only variables from the task defined by the Generation parameter will be returned.

Usage:

You can use this function in any of the following ways:

  1. In an Online or a Rich Client interactive task that browses the data – if you want to export the current data view.

  2. In a Batch or a Rich Client non-interactive task – if you want to export data without browsing it.

    In this case, since the function itself generates and scans the data view, the task that holds the data view definition can end without scanning the records. This task can be defined as follows:

  1. Define the Main Data Source with the data source and ranges on columns according to the data you want to export.

  2. Call the function in the Task Suffix logic unit.

  3. Set the End task condition to Yes and the Evaluate condition to Before entering record. This way the task will not scan all of the records.

Note:

  • When the second parameter is evaluated to 2 or 3, the visibility will depend on the current record. If the function is invoked from the Task Prefix for a task in which the data view has not yet been fetched, then the visibility option will be ignored and all form variables will be fetched. In this case, option=2 and option=1 will retrieve the same variables.

  • If the second parameter is evaluated to an invalid option, the function will return an empty vector.

  • If the second parameter is evaluated to 1, 2 or 3 and there are no variables on the form or if the task's Open Task Window property is set to No, then the function will return an empty vector.

  • The function will only return variables related to the task specified in the generation parameter.

Exceptions:

This function is not supported for Web Service databases.

See also:

DataViewVars

The Online and Rich Client Samples projects (program RP02, RP02b and RRP02, RRP02b)

Since version:

2.3

Reference
Attachment 
Attachment