Salesforce

DataViewVars (Magic xpa 2.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

DataViewVars (Magic xpa 2.x)

Fetches the variables displayed on the form from where the Print Data event was raised.

Syntax:

DataViewVars (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)

Returns:

Variable vector – A vector containing Alpha variables will be returned, containing the names of variables of the displayed 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, 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 either 1 or 2 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. To return the variables from the parent task that are placed on the subtask form, define a variable in the task and initialize (init) it with the parent task's variable.

See also:

DataViewVarsIndex

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

Reference
Attachment 
Attachment