Codeunit "Cues And KPIs"
Exposes functionality to set up and retrieve styles for cues.
Properties
| Name | Value |
|---|---|
| SingleInstance | True |
| Access | Public |
| InherentEntitlements | X |
| InherentPermissions | X |
Methods
OpenCustomizePageForCurrentUser
Opens the cue setup user page with an implicit filter on table id. The page shows previously added entries in the Cue Setup Administration page that have the UserId being either the current user or blank. The page also displays all other fields the that the passed table might have of type decimal or integer. Closing this page will transfer any changed or added setup entries to the cue setup table.
procedure OpenCustomizePageForCurrentUser(TableId: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TableId | Integer |
The ID of the table for which the page will be customized. |
SetCueStyle
Retrieves a Cues And KPIs Style enum based on the cue setup of the provided TableId, FieldID and Amount. The computed cue style is returned by var.
procedure SetCueStyle(TableID: Integer, FieldID: Integer, Amount: Decimal, var FinalStyle: Enum "Cues And KPIs Style")
Parameters
| Name | Type | Description |
|---|---|---|
| TableID | Integer |
The ID of the table containing the field for which the style is wanted. |
| FieldID | Integer |
The ID of the field for which the style is wanted. |
| Amount | Decimal |
The amount for which the style will be calculated based on the threshold values of the setup. |
| FinalStyle | Enum System.Visualization."Cues And KPIs Style" |
The amount for which the style will be calculated based on the threshold values of the setup |
PersonalizedCueSetupExistsForCurrentUser
Checks if a personalized Cue Setup record exists for the current user.
<param name="TableID">The ID of the table containing the field for which the style is wanted.</param> <param name="FieldID">The ID of the field for which the style is wanted.</param>procedure PersonalizedCueSetupExistsForCurrentUser(TableID: Integer, FieldID: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| TableID | Integer | |
| FieldID | Integer |
Returns
| Type | Description |
|---|---|
| Boolean |
If a personalized Cue Setup record exists for the current user. |
ConvertStyleToStyleText
Converts a Cues And KPIs Style enum to a style text. Enum values 0,7,8,9,10 are defined by default, if custom values are needed take a look at OnConvertStyleToStyleText event.
procedure ConvertStyleToStyleText(CueStyle: Enum "Cues And KPIs Style"): Text
Parameters
| Name | Type | Description |
|---|---|---|
| CueStyle | Enum System.Visualization."Cues And KPIs Style" |
A Cues And KPIs Style enum from which the style text will be converted. |
Returns
| Type | Description |
|---|---|
| Text |
The converted style |
InsertData
Inserts cue setup data. The entries inserted via this method will have no value for the userid field.
procedure InsertData(TableID: Integer, FieldNo: Integer, LowRangeStyle: Enum "Cues And KPIs Style", Threshold1: Decimal, MiddleRangeStyle: Enum "Cues And KPIs Style", Threshold2: Decimal, HighRangeStyle: Enum "Cues And KPIs Style"): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| TableID | Integer |
The ID of the table where the cue is defined. |
| FieldNo | Integer |
The ID of the field which the cue is based on. |
| LowRangeStyle | Enum System.Visualization."Cues And KPIs Style" |
A Cues And KPIs Style enum representing the style that cues which have a value under threshold 1 will take. |
| Threshold1 | Decimal |
The lower amount which defines which style cues get based on their value |
| MiddleRangeStyle | Enum System.Visualization."Cues And KPIs Style" |
A Cues And KPIs Style enum representing the style that cues which have a value over threshold 1 but under threshold 2 will take. |
| Threshold2 | Decimal |
The upper amount which defines which style cues get based on their value |
| HighRangeStyle | Enum System.Visualization."Cues And KPIs Style" |
A Cues And KPIs Style enum representing the style that cues which have a value over threshold 2 will take. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the data was inserted successfully, false otherwise |
Events
OnBeforeGetCustomizedCueStyleOption
Event that allows definition of cue style for a cue using style enum without the usage of a cue setup table. Subscribe to this event if you want to define a cue style for a cue using custom prerequisites.
[IntegrationEvent(False,False)]
internal procedure OnBeforeGetCustomizedCueStyleOption(TableID: Integer, FieldNo: Integer, CueValue: Decimal, var CueStyle: Enum "Cues And KPIs Style", var Resolved: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| TableID | Integer |
The ID of the table where the cue is defined. |
| FieldNo | Integer |
The ID of the field which the cue is based on. |
| CueValue | Decimal |
Cue value parameter that can be used to determine cue style. |
| CueStyle | Enum System.Visualization."Cues And KPIs Style" |
Exit parameter that holds newly determined cue style based on custom prerequisites. |
| Resolved | Boolean |
A boolean value that describes whether or not the cue style has been determined. |