Export (0) Print
Expand All

Walkthrough: Creating a Cue on a Role Center

Microsoft Dynamics Nav 2009

The following walkthrough demonstrates how to add a Cue on the RoleTailored client. A Cue provides a way to graphically show the number of entities in a table and view the entities in a filtered list. For example, the Cue can show total number of open invoices, sales orders, or credit memos. As shown in the following figure, a Cue is an icon that depicts a stack of papers on the page, where the height of the stack roughly indicates the number of entities in an underlying table. A number value on each Cue gives the precise count. The Cue provides a shortcut link to a filtered list page for displaying the entities. You can also add actions to a Cue that open related tasks that a user of the Role Center will typically perform.

Ff477101.Local_-1566160533_navrtccueexample(en-us,NAV.60).png

This walkthrough illustrates the following tasks:

Roles

This walkthrough demonstrates tasks performed by the following user roles:

  • Microsoft .NET developer.

  • Microsoft Dynamics NAV developer and IT pro.

Prerequisites

To complete this walkthrough, you need:

  • Microsoft Dynamics NAV 2009 with a developer license.

  • All Microsoft Dynamics NAV 2009 requirements met. For more information, see Microsoft Dynamics NAV 2009 SP1 Requirements.

  • Microsoft Dynamics NAV 2009 demo database. The walkthrough uses the following objects:

    • Table 36, Sales Header

    • Page 9006, Order Processer Role Center

    • Page 9301, Sales Invoice List

    • Page 43, Sales Invoice

Simon is a software developer who is working for CRONUS International Ltd. He has been asked to add a Cue to the Role Centers of sales order processors. The Cue will show how many open sales invoices that they have. To accomplish this, Simon will create a Cue that extracts the number of open sales invoices from the Sales Header table. He will place the Cue in a part on the Order Processor Role Center page. He will also add an action that allows users to create a new sales invoice from a link on the Cue. The Cue will look similar to the previous figure.

To calculate the number of open sales invoices, Simon creates a table that includes a FlowField that extracts data from the Sales Header table and calculates how many opens sales invoices exist. Because a table must have at least one data field and a FlowField is based on a calculation and not considered an actual data field, Simon adds a dummy primary key field that does not yield any data. For more information about FlowFields, see FlowFields Overview.

To create a table that includes fields for the Cue data

  1. In the Classic Client, on the Tools menu, click Object Designer.

  2. Click Table, and then click New.

  3. In the first empty row, in the Field Name, type Primary Key and set the Data type to Code.

  4. In the next empty row, in the Field Name, type Sales Invoices - Open and set the Data type to Integer.

    This defines the Cue data field.

To define a filter on the cue data field

  1. Click the Sales Invoices - Open field row, and then on the View menu, click Properties.

  2. In the Properties window, set the FieldClass property to FlowField.

  3. In the CalcFormula property, click the AssistEdit button to open the Calculation Formula window.

  4. In the Calculation Formula window, set the Method field to Count and the Table field to Sales Header.

  5. In the Table Filter field, click the AssistEdit button to open the Table Filter window.

  6. In the first line of the Table Filter window, click the AssistEdit button.

  7. In the Sales Header - Field List window, select Document Type, and then click OK to return to the Table Filter window.

  8. In the Document Type row, set the Type column to FILTER and type Invoice in the Value column. This filters the Sales Header table on sales invoices.

  9. On the next empty row, click the AssistEdit button.

  10. In the Sales Header - Field List window, select Status, and then click OK to return to the Table Filter window

  11. In the Status row, set the Type column to FILTER and type Open in the Value column. This filters the Sales Header table on open sales invoices.

    The Table Filters window will look similar to the following figure:

    Ff477101.Local_1512249333_navrtccuetablefilterexample(en-us,NAV.60).png
  12. Click OK until you return to the Properties window, and then close the Properties window to return to Table Designer.

To save the table

  1. On the File menu, click Save.

  2. In the ID field, type a number that will serve as a unique table identifier.

    NoteNote

    There are restrictions about which numbers you can use. Contact your Microsoft Certified Partner for information.

  3. In the Name field, type Sales Invoice Cue.

  4. Select the Compiled check box.

  5. Click OK.

To set the table primary key and save the table

  1. In Table Designer, select an empty row, and then on the View menu, click Keys.

  2. In the Keys window, select the first line, and then in the Key column, select the AssistEdit button.

  3. In the Field List window, select the first row, and then click the AssistEdit button.

  4. Select Primary Key field, and then click OK until you return to the Keys window.

  5. Close the Keys window to return to Table Designer.

  6. On the File menu, click Save.

To display the Sales Invoice Cue on the Role Center, Simon creates a card part page type that has a CueGroup control that includes the Sales Invoices - Open field of the Sales Invoice Cue table. Simon also needs to initialize the data field on the Cue with a record, so he adds code to the OnOpenPage trigger of the card part page type.

To create the card part page for the Sales Invoice Cue

  1. In the Classic client, on the Tools menu, click Object Designer.

  2. In Object Designer, click Page, and then click New. The New Page dialog box opens.

  3. In the Table text box, click the AssistButton to open the Table List window.

  4. Select the Sales Invoice Cue table that you created in the previous procedure, and then click OK to return to the page wizard,

  5. Click Create blank page, and then click OK.

    The new page appears in Page Designer.

  6. In the Caption field of the first row, which has the type Container and the subtype ContentArea, type SalesInvoiceContainer.

  7. Select a blank row, and then on the View menu, click Properties.

  8. Locate the PageType property, and then set the Value field to CardPart.

  9. Close the Properties window to return to Page Designer.

To add the Sales Invoice Cue on the card part page

  1. In the row after the ContentArea row, set Type to Group and set SubType to CueGroup. In the Caption column, type Sales Invoices.

    The Caption value defines the heading for the Cue that appears on the Role Center.

  2. On the next row, set the Type column to Field. In the Caption column, type Open. The Caption value defines the text that appears below the Cue.

  3. With the row selected, on the View menu, click Field Menu.

    The Field Menu window opens and displays the list of available fields from the Sales Invoice Cue table.

  4. Select Sales Invoices - Open field, and then click OK.

    Page Designer should look similar to the following figure:

    Ff477101.Local_-1987664131_navrtccuepagedesignerexample(en-us,NAV.60).png
  5. To create a link from the Cue to the Sales Invoice List page for displaying the open invoices, select the Sales Invoices - Open field row, and then on the View menu, click Properties.

  6. In the Properties window, set the DrillDownFormID property to Sales Invoice List.

  7. Close the Properties window.

  8. To initialize the cue with a record when the page opens, you must add code to the page's OnOpenPage trigger. In Page Designer, select an empty row, and then on the View menu, click C/AL code.

  9. In the C/AL Editor, type the following code in the OnOpenPage trigger:

    RESET;
    IF NOT GET THEN BEGIN
      INIT;
      INSERT;
    END;
    
  10. Close the C/AL Editor.

To save the sales invoice Cue card part

  1. On the File menu, click Save.

  2. In the ID field, type a number that will serve as a unique page identifier.

    NoteNote

    There are restrictions about which numbers you can use. Contact your Microsoft Certified Partner for information.

  3. In the Name field, type Sales Invoice Cue.

  4. Select the Compiled check box.

  5. Click OK.

  6. To run the page, in Page Designer, select the page, and then click Run.

  7. The RoleTailored client opens and displays the new page.

Simon wants to add a link on the Cue that allows the user to create a new sales invoice. To accomplish this, he creates an action on the CueGroup control that targets the Sales Invoice page.

To add actions to the sales order queue page

  1. In Page Designer for Sales Invoice Cue page, select the Sales Invoices CueGroup row.

  2. On the View menu, click Actions.

  3. In the first row of Action Designer, in the Caption column, type New Sales Invoice and set the Type column to Action.

  4. With the first row selected, on the View menu, click Properties.

  5. In the Properties window, do the following:

    • Set the RunFormMode property to Create.

    • Set the RunObject property to Page Sales Invoice

  6. Close the Properties window, and then close Action Designer.

  7. Save the page.

To display the Sales Invoice Cue on the Role Center, Simon must add the Sales Invoice Cue card part page to the Role Center page for sales order processors. To do this, he adds a part to the Order Processor Role Center page that targets the new Sales Invoice Cue card part page.

To add the Sales Invoice Cue to the Role Center page

  1. In Object Designer, click Page to display the list of pages.

  2. Locate page 9006, Order Processor Role Center, and then click Design.

  3. In Page Designer, locate the Group control in which you want to include the Sales Invoice Cue page.

  4. To insert a new row, right-click a row below the Group control, and then click New.

  5. In the new row, set the Type column to Part.

  6. On the View menu, click Properties.

  7. Set the PartType property to Page.

  8. In the PagePartID property, click the AssistButton button in the value field.

    The Page List window opens.

  9. Click the Sales Invoice Cue page and then click OK.

    The Sales Invoice Cue page is the card part page that you created earlier in this walkthrough. For more information, see Creating a Cue on a Card Page for the Role Center.

  10. Save the page.

  11. Run the page.

Community Additions

ADD
Show:
© 2014 Microsoft