Creating and Customizing Cues
This topic provides an overview of Cues and the tasks involved in creating and customizing a Cue for displaying on a page the Dynamics NAV clients.
This topic contains the following sections:
For step-by-step instructions on many of the tasks discussed in this topic, see Walkthrough: Creating a Cue Based on a FlowField and Walkthrough: Creating a Cue Based on a Normal Field and a Query.
Cue Design Overview
The implementation of a Cue involves the following elements:
A table object with a field that holds the data that is contained in the Cue at runtime.
A page object that contains the table field and displays the Cue in the Dynamics NAV client.
Logic that calculates the data to display in the Cue at runtime.
The logic can consist of a combination of C/AL and Dynamics NAV objects, such as tables, queries, and codeunits. How and where you implement the logic will depend on whether the Cue is based on a FlowField or Normal field and what you want to achieve.
Supported Data Types
You can only base Cues on integer and decimal data types. Other data types are not supported and will not display in a Cue.
FlowFields versus Normal Fields
A Cue can be based on a FlowField or Normal field. If you base the Cue on a FlowField, then you add the logic that calculates the data for the Cue to the CalcFormula Property of the FlowField. If you use a Normal field, then you will typically add the logic that calculates the Cue data to a C/AL trigger or function. Unlike a FlowField, where data is extracted from tables, a Normal field enables you to extract data from other objects such as queries.
Creating a Table for Cue Data
The first thing that you must do is to create a table that contains fields that will hold the calculated data to display in the Cues at runtime.
If you already have a table for your Cues, then you can just add a new field to the existing table.
Adding a Field for the Cue Data
For each Cue that you want to display on the page, you must add a Field control in the table. When you add the Field control, specify the following properties.
Set the Data Type Property to Decimal, Integer, or Text, depending on the type of data the Cue will display.
Set the FieldClass Property to FlowField or Normal.
If field is a FlowField, then set the CalcFormula Property to calculate the Cue data. For more information, see and How to: Create, View, and Edit a Calculation Formula.
Adding a Primary Key Field for FlowFields
A table must have at least one data field. Because a FlowField is based on a calculation, it not considered an actual data field. Therefore, if the Cue table only includes FlowFields, you must add "dummy" primary key field that does not yield any data.
To add primary key, for example, add a field with the name Primary Key, and then set its data type to Code.
Creating a Page for the Cues
After you have a table for holding the Cue data, you create a page that you associate the table, and then add fields on the page for the Cues. Typically, you will create Card Part type page that will be part of the Role Center page.
Adding the Cue Fields
To setup the Cues on a page, you add a CueGroup control, and then for each Cue that you want to display, you add a Field control. The following figure illustrates the Page Designer for a page that contains two Cues.
Initializing the Cue Fields
You must initialize the Cue fields on the page. To do this, for example, you can add the following C/AL code to the OnOpenPage Trigger.
RESET; IF NOT GET THEN BEGIN INIT; INSERT; END;
Customizing a Cue
This section contains information about how you can change the appearance of the Cues.
Specifying an Image on the Cue
You can specify an image to display on the Cue or you can choose not to display an image at all. You can select from several available images.
For more information, see How to: Set Up an Image on a Cue.
Setting up a Drill Down Page on the Cue
You can set up a Cue to link to a page that displays details about the transactions that make up the data in the Cue. This page is referred to as a drill down page. For example, if the Cue displays the number of open sales orders, then you can set up the Cue to link to list page that includes the sales orders. The page opens when a user selects the Cue.
To set up a drill down page, you can do one of the following:
Set the DrillDown Property of the Cue field on the page to the ID of the page that you want to open from the Cue.
You can add code to the OnDrillDown Trigger of the Cue field on the page that contains the Cue.
The OnDrillDown trigger takes precedent over the DrillDown property.
When the Cue is on a Role Center page type, an item that links to the drill down page will automatically appear in the navigation pane of the Role Center under Home if the navigation pane contains an entity of the same type. For example, if you have a Cue named Sales Return Orders – Open, this item will be added to the Sales Return Orders in the navigation pane.
Formatting the Data in the Cue
If the data type on the Cue is a decimal, then you can change how the data is displayed, including converting amounts and unit amounts to another currency, specifying the number of decimal places and thousand separator, and adding characters before or after the value.
For more information, see the Formatting the Data in a Field.
Adding an Action to the Cue
When the Cue is displayed in the Microsoft Dynamics NAV Windows client client, you can add an action next to the Cue that opens a related task. For example, if the Cue displays the open sales orders, then you can add an action the opens the Sale Order card page for creating a new sales order.
To set up an action, open the page that contains the Cue in the development environment, and then add a Control action on the CueGroup control that contains the Cue field. Set the RunObject Property of the action to the object, such as a page, that you want to target.
This is not supported in the Microsoft Dynamics NAV Web client or Microsoft Dynamics NAV Tablet client.
Setting up Colored Indicators on Cues
You can set up Cues to include a colored bar along the top border, which changes color based on the data in the Cue.
For more information, see Setting Up Colored Indicators on Cues.