Dashboard Business Rules
Dashboard Business Rules power the server-side logic behind interactive dashboards. There are three types — each serving a different purpose in the dashboard lifecycle. This guide covers all three with complete code examples, the LoadDashboard lifecycle, and the PageState API for storing custom state.
Dashboard BR Types
Dashboard Extender
The Dashboard Extender handles dashboard lifecycle events and user interactions. It receives a
DashboardExtenderArgs object with properties that describe what triggered the rule and provide context.DashboardExtenderArgs Properties
| Property | Type | Description |
|---|---|---|
| FunctionType | DashboardExtenderFunctionType | Which event triggered the rule (see enum below) |
| FunctionName | String | The function name from curly brace syntax {BR}{FunctionName}{NVPs} |
| NameValuePairs | Dictionary(Of String, String) | Key-value pairs from curly brace syntax |
| PrimaryDashboard | Dashboard | The top-level dashboard object |
| EmbeddedDashboard | Dashboard | The embedded dashboard (if the component is in one) |
| ComponentInfo | DashboardCompInfo | Information about the component that triggered the event |
| PageInstanceInfo | PageInstanceInfo | Information about the current page instance |
| LoadDashboardTaskInfo | XFLoadDashboardTaskInfo | Context for LoadDashboard events (Reason, Action) |
| SelectionChangedTaskInfo | XFSelectionChangedTaskInfo | Context for selection change events |
| SqlTableEditorSaveDataTaskInfo | XFSqlTableEditorSaveDataTaskInfo | Context for DynamicGrid save events |
DashboardExtenderFunctionType Enum
| Value | Name | Triggered By |
|---|---|---|
| 0 | LoadDashboard | Dashboard is loading (opening or refreshing) |
| 1 | ComponentSelectionChanged | User clicked a Button or changed a selection in a ComboBox/ListBox |
| 2 | SqlTableEditorSaveData | User saved changes in a DynamicGrid |
LoadDashboard
The LoadDashboard function type fires when a dashboard opens or refreshes. It provides two key properties on
args.LoadDashboardTaskInfo that tell you why and when the rule is firing.LoadDashboardTaskInfo Properties
| Property | Values | Description |
|---|---|---|
| Reason | Initialize, ComponentSelectionChanged | Initialize on first load. ComponentSelectionChanged when a component refresh triggers a reload. |
| Action | BeforeFirstGetParameters, BeforeSubsequentGetParameters, BeforeGetDashboardDisplayInfo | Which phase of the load lifecycle the rule is currently in. |
LoadDashboard Example: Set Default Parameter Values
ComponentSelectionChanged
Fires when a user clicks a Button or changes a selection in a ComboBox/ListBox that has a server task configured. The curly brace syntax on the component maps directly to
args.FunctionName and args.NameValuePairs.ComponentSelectionChanged Example
SqlTableEditorSaveData
Handles DynamicGrid save operations. See DynamicGrid and SQL Table Editor for the full save handler pattern with
XFSqlTableEditorSaveDataTaskInfo and XFSqlTableEditorSaveDataTaskResult.Dashboard DataSet
Dashboard DataSet BRs provide data to components via Custom data adapters. The BR implements two function types:
GetDataSetNames (returns a list of available dataset names) and GetDataSet (returns a DataTable for a specific dataset).DashboardDataSetArgs Properties
| Property | Type | Description |
|---|---|---|
| FunctionType | DashboardDataSetFunctionType | GetDataSetNames or GetDataSet |
| DataSetName | String | The requested dataset name (populated for GetDataSet) |
| PageInstanceInfo | PageInstanceInfo | Current page instance info |
| NameValuePairs | Dictionary(Of String, String) | Additional context passed from the adapter configuration |
| CustomSubstVars | Dictionary(Of String, String) | Custom substitution variables |
Dashboard DataSet Example
Dashboard String Function (XFBR / BRString)
Dashboard String Function BRs return string values used in dashboard component parameters and properties. They are called using
BRString(...) or XFBR(...) syntax wherever a parameter or property value is needed.DashboardStringFunctionArgs Properties
| Property | Type | Description |
|---|---|---|
| FunctionName | String | The function name from the BRString(RuleName, FunctionName, ...) call |
| NameValuePairs | Dictionary(Of String, String) | Key-value pairs from the BRString(RuleName, FunctionName, Key=Value) call |
| PageInstanceInfo | PageInstanceInfo | Current page instance info |
| SubstVarSourceInfo | SubstVarSourceInfo | Context about the substitution variable source |
| CustomSubstVars | Dictionary(Of String, String) | Custom substitution variables from the dashboard |
Calling Syntax
- BRString:
BRString(RuleName, FunctionName, Param1=Value1, Param2=Value2) - XFBR:
XFBR(RuleName, FunctionName)(no name-value pairs) - Assembly XFBR:
XFBR(Workspace.WorkspaceName.AssemblyName.FileName, FunctionName)
String Function Example
Usage in dashboard component properties:
BRString(MyStringBR, GetEntityDescription, Entity=[|!SelectedEntity!|])— Returns entity descriptionBRString(MyStringBR, IsUserAdmin)— Returns True/False for conditional logicBRString(MyStringBR, GetVisibility, Scenario=[|!ScenarioParam!|])— Controls IsVisible property
PageState
The PageState API lets you store and retrieve custom key-value pairs scoped to the current page instance. Values persist across interactions within the same dashboard session but are cleared when the user navigates away.
PageState is useful for tracking multi-step processes, remembering the user's last action, or passing state between sequential button clicks without using visible parameters.
Related Content
- Getting Started with Business Rules — Dashboard rule type overview
- Organizing Your Business Rule Code — Dashboard DataSet and Dashboard Extender code organization examples
- Getting Started with Workspace Assemblies — Service Factory pattern for dashboard BRs, DashboardStringFunctionBR source code type
- Referencing Assemblies and Sharing Code — Assembly-based XFBR syntax
- Writing Calculations — CustomCalculate triggered from dashboards
- DynamicGrid and SQL Table Editor — Full SqlTableEditorSaveData implementation