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.
About This Walkthrough
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
Prerequisites
To complete this walkthrough, you will need:
Story
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.
Creating a Worksheet Page
Note |
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
-
In the Classic client, on the Tools menu, click Object
Designer.
-
In Object Designer, click Page, and then click
New. The New Page dialog box appears.
-
In the Table text box, click the AssistButton,
select the table 83, Item Journal Line, and then click
OK.
-
Click Create blank page, and then click OK.
The new page appears in Page Designer.
-
In the Name field of the first row, which has the type
Container and the subtype ContentArea, type
Susan's Item Journal.
-
Select a blank row, and on the View menu, click
Properties.
-
Locate the PageType property, and then set the
Value field to the page type Worksheet.
-
Close the Properties window.
Adding a Batch Name Control
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
-
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.
-
With the second row still selected, open the Properties
window, and set the SourceExpr property to
CurrentJnlBatchName.
Note |
Your page will not compile until you have added the
CurrentJnlBatchName variable to C/AL Globals.
|
-
Set the LookUp property to Yes.
-
Save your new page and name it Susan's Item Journal. Set
the page ID to 50007 or another value in the 50000
range.
Note |
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.
|
Adding Field a Repeater
Control
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
-
Open page 50007, Susan's Item Journal in Page
Designer.
-
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.
-
In the next blank row, set Type to Field. You
cannot set a SubType when you select Field.
-
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.
-
Close the Page Designer window and save your changes.
Adding Fixed Layout Controls
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
-
Open page 50007, Susan's Item Journal in Page
Designer.
-
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.
-
On the next row, set Type to Group and
SubType to FixedLayout.
-
In the next available row, set Type to Group and
SubType to Group.
-
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.
-
Save and preview your page. You can now see that Item
Description is displayed at the bottom of your worksheet
page.
Note |
To link Item Description to Batch Lines you must add the
variable Item Description to C/AL Globals in Object
Designer.
|
Adding FactBoxes
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
-
Open page 50007, Susan's Item Journal in Page
Designer.
-
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.
-
Use the left indentation arrow to negative indent your FactBox
until it has zero indention and matches the top level
ContentArea container element.
-
In the next row, set Type to Part, and accept all
other default values in this row.
-
With the same row selected, click View, and then click
Properties to open the Properties window. Set the
PagePartID property to Item Replenishment
FactBox.
-
Set the Visible property to FALSE. This FactBox
remains hidden until the user decides to add it to the page.
-
Close the Properties window.
-
In the next available empty row, add another Part for the
RecordLinks FactBox.
-
Open the Properties window.
-
In the Properties window, set the following
properties.
Property |
Value |
SystemPartID
|
RecordLinks
|
PartType
|
System
|
Visible
|
FALSE
|
-
In the next available empty row in Page Designer, add
another Part for the Notes FactBox.
-
Open the Properties window.
-
In the Properties window, set the following
properties.
Property |
Value |
SystemPartID
|
Notes
|
PartType
|
System
|
Visible
|
FALSE
|
-
Close the Properties window.
-
Check the indentation of your page elements and adjust if
necessary.
-
Close and save your page.
The following illustration shows the indentation of elements on
the worksheet page after adding FactBoxes.
Running the Page
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.
Next Steps
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.
See Also