Walkthrough: Creating a Worksheet Page

In Microsoft Dynamics NAV you can use a worksheet page type to create two types of pages:

  • Worksheet pages - To present data in a list and offer a choice of actions to the user. For example, page 5841, Standard Cost worksheet.

  • Journal pages - To perform tasks, such as posting transactions. For example, page 40, the Item Journal.


Worksheet pages always open in edit mode and can display lists of data in a grid control and in lines. Lines can be filled in by a user or by running a batch job. You can add other controls to a worksheet page, such as a filter or FactBox, but you cannot add a chart pane. These controls can also be added or removed by the user as part of their user personalization options. Actions can be added to the navigation of a worksheet page, some of which may be promoted by the user to the Action Pane.

In this walkthrough, you learn how to create a new item journal worksheet that displays item journal lines for Susan, the order processor. Susan often uses the posting action on the Item Journal page to adjust her inventory in relation to purchases and sales.

This walkthrough provides on overview of how to create a journal worksheet page and how to add controls to display items from table 83 Item Journal Line.

This walkthrough illustrates the following tasks:

  • Creating a worksheet page

  • Adding a batch name control

  • Adding a field repeater control

  • Adding a fixed layout control

  • Adding FactBoxes

  • Running the page


To complete this walkthrough, you will need:

  • Microsoft Dynamics NAV 2009 installed with a developer license

Simon is a partner working for CRONUS International Ltd.. Susan, the order processor asks Simon to create an Item Journal worksheet page for her, which she can use to keep her item inventory up to date.


In this walkthrough, to learn about the properties and controls of a worksheet page, you will create worksheet page from a blank page. If you are running Microsoft Dynamics NAV 2009 SP1, Object Designer also includes a wizard that you can use to create a worksheet page that sets up many properties and controls for you. For more information about the wizard, see How to: Create a Page.

To create a worksheet page

  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 appears.

  3. In the Table text box, click the AssistButton, select the table 83, Item Journal Line, and then click OK.

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

    The new page appears in Page Designer.

  5. In the Name field of the first row, which has the type Container and the subtype ContentArea, type Susan's Item Journal.

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

  7. Locate the PageType property, and then set the Value field to the page type Worksheet.

  8. Close the Properties window.

First, Simon needs to add a batch name control to the top of his worksheet page, so Susan can select which batch item she wants to run from the Item Journal Batch table.

To add a batch name control

  1. In Page Designer, select the second row, type CurrentJnlBatchName in the Name field, and set Type to Field. This element is automatically indented one space below your Container element.

  2. With the second row still selected, open the Properties window, and set the SourceExpr property to CurrentJnlBatchName.


    Your page will not compile until you have added the CurrentJnlBatchName variable to C/AL Globals.

  3. Set the LookUp property to Yes.

  4. Save your new page and name it Susan's Item Journal. Set the page ID to 50007 or another value in the 50000 range.


There a number of other variables, constants, and functions that you must define in C/AL Globals before this control can be fully functional. Instructions on how to add these is beyond the scope of this walkthrough.

Next, Simon must use the Field Menu to add fields to Susan's Item Journal page. In a worksheet page these fields are displayed horizontally, like lines.

To add field repeater controls

  1. Open page 50007, Susan's Item Journal in Page Designer.

  2. In the third row, type a Name for your control or leave it blank. Set Type to Group and SubType to Repeater. If you have left the Name field blank, when you click outside this row, a default name for this control is added automatically.

  3. In the next blank row, set Type to Field. You cannot set a SubType when you select Field.

  4. With the new Field row selected, click View, and then click Field Menu. The Field Menu window displays fields available from table 83, Item Journal Line. Select multiple fields from this table by holding down the CTRL key while you make your selection. For this walkthrough select the following fields:

    • Posting Date

    • Document Date

    • Entry Type

    • Document No.

    • External Document No.

    • Item No.

    • Variant Code

    • Description

    If the OK and Cancel buttons are unavailable, see Page Designer Troubleshooting for more information.

    You have now successfully added a Repeater control to your worksheet page.

  5. Close the Page Designer window and save your changes.

Next, Simon needs to create a Fixed Layout control. On an Item Journal page, this type of control can be used to show a description at the bottom of the page for the item displayed in the batch line.

To add a fixed layout control

  1. Open page 50007, Susan's Item Journal in Page Designer.

  2. In the next available row below the repeater controls, set Type to Group and SubType to Group. Negative indent this row one space, using the arrows provided in Page Designer. Your fixed layout control should be indented at the same level as your repeater control.

  3. On the next row, set Type to Group and SubType to FixedLayout.

  4. In the next available row, set Type to Group and SubType to Group.

  5. Finally, in the next available row, set Type to Field. Type Item Description in the Name field and accept the default indentation as you add these elements to the page.

  6. Save and preview your page. You can now see that Item Description is displayed at the bottom of your worksheet page.


    To link Item Description to Batch Lines you must add the variable Item Description to C/AL Globals in Object Designer.

Simon has decided to add three FactBoxes to Susan's worksheet page:

  • Item Replenishment

  • RecordLinks

  • Notes

Item Replenishment is a FactBox based on an existing page, while RecordLinks and Notes are both system FactBoxes. Simon wants all these FactBoxes to be hidden unless Susan decides to show them as part of her personalization options.

To add FactBoxes to a worksheet page

  1. Open page 50007, Susan's Item Journal in Page Designer.

  2. In the first available empty row, set Type to Container and SubType to FactBoxArea. Click anywhere outside this row to accept the default value in the Name field.

  3. Use the left indentation arrow to negative indent your FactBox until it has zero indention and matches the top level ContentArea container element.

  4. In the next row, set Type to Part, and accept all other default values in this row.

  5. With the same row selected, click View, and then click Properties to open the Properties window. Set the PagePartID property to Item Replenishment FactBox.

  6. Set the Visible property to FALSE. This FactBox remains hidden until the user decides to add it to the page.

  7. Close the Properties window.

  8. In the next available empty row, add another Part for the RecordLinks FactBox.

  9. Open the Properties window.

  10. In the Properties window, set the following properties.

    Property Value







  11. In the next available empty row in Page Designer, add another Part for the Notes FactBox.

  12. Open the Properties window.

  13. In the Properties window, set the following properties.

    Property Value







  14. Close the Properties window.

  15. Check the indentation of your page elements and adjust if necessary.

  16. Close and save your page.

    The following illustration shows the indentation of elements on the worksheet page after adding FactBoxes.


Test your new worksheet page in the RoleTailored client.

To run the page

  • In Page Designer, select the page, and then click Run.

    The RoleTailored client opens and displays the new worksheet page.

Simon has now created a basic worksheet page. He must remember to add the variables, constants, and functions necessary to make the worksheet page function correctly. He would also like to add some posting actions, some of which he will promote to the Action Pane.

For more information about adding variables, constants, and functions, see Developing Codeunits.

Community Additions