Available Context Information
An action can use context information — values from the dashboard, based on the row or rows that the user selected before launching the action. These values are useful if you want to cause changes in the database that are dependent on context.
Because %OnDashboardAction() is a class method, you do not have access to %seriesNames or other properties of the KPI class from within this method. Instead, the system provides the pContext variable, which is an object whose properties provide information for use in the action. The details are different in the following scenarios:
Scenario: Pivot Table Widget with Pivot Table as Data Source
In this scenario, within the %OnDashboardAction() method, the pContext variable has the following properties:
Property Name | Property Contents |
---|---|
currValue | Value of first selected cell |
currSeriesNo | Column number |
currItemNo | Row number |
currFilterSpec | MDX %FILTER clause or clauses that represent the filtering applied to the current cell context. This includes values of any filter controls, as well as the row and column context. |
valueList | Null |
cubeName | Name of the cube queried by this pivot table |
mdx | MDX query defined by this pivot table |
pivotVariables | A proxy object that contains one property for each pivot variable. Specifically, pContext.pivotVariables.varname contains the value of the pivot variable varname. In this proxy object, all pivot variable names are in lowercase. For example, if the server defines a pivot variable named MyVar, this pivot variable is available as pContext.pivotVariables.myvar |
filters | An array that indicates the current values of all filter controls. For each node in this array, the subscript is the name of a filter defined by the KPI. The value of the node is the corresponding key or keys, in the form described at “Allowed Default Values for Filters”. |
dataSource | Name of the current data source |
Scenario: Pivot Table Widget with Listing as Data Source
In this scenario, within the %OnDashboardAction() method, the pContext variable has the following properties:
Property Name | Property Contents |
---|---|
currValue | Value of the first selected cell that was displayed before the listing was shown |
currSeriesNo | Column number of the first selected cell that was displayed before the listing was shown |
valueList | Comma-separated list of values from the first column of the listing (these values must not contain commas) |
pivotVariables | A proxy object that contains one property for each pivot variable. Specifically, pContext.pivotVariables.varname contains the value of the pivot variable varname. In this proxy object, all pivot variable names are in lowercase. For example, if the server defines a pivot variable named MyVar, this pivot variable is available as pContext.pivotVariables.myvar |
filters | An array that indicates the current values of all filter controls. For each node in this array, the subscript is the name of a filter defined by the KPI. The value of the node is the corresponding key or keys, in the form described at “Allowed Default Values for Filters”. |
dataSource | Name of the current data source |
Scenario: Pivot Table Widget with KPI as Data Source
In this scenario, within the %OnDashboardAction() method, the pContext variable has the following properties:
Property Name | Property Contents |
---|---|
currValue | Value of first selected cell |
currSeriesNo | Column number of first selected cell |
valueList | Null |
pivotVariables | A proxy object that contains one property for each pivot variable. Specifically, pContext.pivotVariables.varname contains the value of the pivot variable varname. In this proxy object, all pivot variable names are in lowercase. For example, if the server defines a pivot variable named MyVar, this pivot variable is available as pContext.pivotVariables.myvar |
filters | An array that indicates the current values of all filter controls. For each node in this array, the subscript is the name of a filter defined by the KPI. The value of the node is the corresponding key or keys, in the form described at “Allowed Default Values for Filters”. |
dataSource | Name of the current data source |
Scenario: Scorecard with KPI as Data Source
In this scenario, within the %OnDashboardAction() method, the pContext variable has the following properties:
Property Name | Property Contents |
---|---|
currValue | Value of the KPI property that is marked as Value Column in this scorecard |
currSeriesNo | Row number |
valueList | Value of the KPI property that is marked as Value Column in this scorecard |
pivotVariables | A proxy object that contains one property for each pivot variable. Specifically, pContext.pivotVariables.varname contains the value of the pivot variable varname. In this proxy object, all pivot variable names are in lowercase. For example, if the server defines a pivot variable named MyVar, this pivot variable is available as pContext.pivotVariables.myvar |
filters | An array that indicates the current values of all filter controls. For each node in this array, the subscript is the name of a filter defined by the KPI. The value of the node is the corresponding key or keys, in the form described at “Allowed Default Values for Filters”. |
dataSource | Name of the current data source |