AX1805

GetPlanItemValue data lookup

You can use GetPlanItemValue rows in a DataLookup data source to return values from the plan code table, for the current plan code. It is intended to be used in plan files.

When a plan file is opened, all values from the plan code table for that plan code are automatically loaded into document memory and can be retrieved using GetPlanItemValue. Using GetPlanItemValue instead of GetData eliminates the need to make round-trip server calls to the database to display this information in plan files.

The GetPlanItemValue data lookup supports similar query parameters as the GetPlanItemValue function, and can be used as a substitute for this function to improve file performance. The data lookup is intended to be used in cases where the queried value is not expected to change during the current file session, and therefore the value only needs to be queried once (or only after specific events).

To create a GetPlanItemValue data lookup, add a [GetPlanItemValue] row to a DataLookup data source and add the appropriate parameter columns. For more information on creating the DataLookup data source, see Creating DataLookup data sources.

GetPlanItemValue parameters

[GetPlanItemValue] rows use the following parameter columns. Within the DataLookup control row, these parameter names must be placed in square brackets—for example, [ColumnName]. The parameters can be placed in any order.

NOTE: If the entry for any parameter depends on a value returned by another data lookup row, then that row must be in a different data source and executed before this row is executed. For more information, see Dependent data lookups.

Parameter Description

ColumnName

The name of any column in the plan code table for the file group. Use only the column name, not full Table.Column syntax. For example, if you want to return a description from the Description column, use Description (not Dept.Description).

GetPlanItemValue returns the value in this column, for the current plan code.

Remarks

  • GetPlanItemValue only returns values when used in a plan file. When setting up the function in the file group template, it will return an expected error.

  • The related values from the plan code table are loaded into document memory when the plan file is opened. If any of these values change while the plan file is still open in the current session, GetPlanItemValue will not reflect these changes. If a particular value may change often and you need to reflect this change in the current session, you should use GetData instead.

Example

The following screenshot of a DataLookup data source shows several GetPlanItemValue examples: