Solutions: What's New: Developing Solutions For Microsoft Dynamics NAV 6.0
Solutions: What's New: Developing Solutions For Microsoft Dynamics NAV 6.0
Solutions: What's New: Developing Solutions For Microsoft Dynamics NAV 6.0
What’s New:
Developing Solutions for
Microsoft Dynamics™ NAV ―6.0‖
White Paper
November 2007
www.microsoft.com/dynamics/nav
Table of Contents
Introduction ............................................................................................................................................... 3
Appendix ................................................................................................................................................. 36
Forms ................................................................................................................................................................................................. 36
Reports .............................................................................................................................................................................................. 36
XMLports and Dataports ............................................................................................................................................................ 37
RoleTailored
SharePoint client
Windows Forms
client
Client tier
rich client
Browser
SharePoint
Web services Client services display target
render
SharePoint Services
Server tier
Metadata
Application Data binder
provider
SQL Server
To support this user interface, Microsoft Dynamics NAV displays data in the RoleTailored client in a
model-driven way and relies on metadata to display this data. Also, business logic code is no longer
run on the client. Instead, requests to run C/AL code are sent to the middle tier.
Previous versions of Microsoft Dynamics NAV and the Classic client in Microsoft Dynamics NAV ―6.0‖
display data in forms, such as card forms or list forms. You design forms in a WYSIWYG environment
with precise layout information.
The new RoleTailored client now displays data in pages, and you design these pages in Page Designer.
The page elements are listed in their relative display order, and the properties that are associated with
each element are used to specify special presentation features but without any size or position
specifications. This allows a page to be consumed by different clients without being constrained by
layout limitations, and each client can render the page in a different way.
Report Same as previous versions of Microsoft Report datasets, sections, and request
Dynamics NAV. forms or pages are designed in the C/SIDE
Reports have three new properties that Report Designer.
are ignored. Report layout is designed with a report
definition language editor such as Visual
Studio. The layout information is stored in
the new properties in the report object.
Table Same as previous versions of Microsoft Designed and executed in the same way as
Dynamics NAV. in the Classic client, with the same triggers
A new ExtendedDataType property and properties.
has been added but has no affect on The new ExtendedDataType property
table behavior. allows you to add metadata to fields to
Code and triggers run on the client. change how they are rendered.
Code and triggers run on Microsoft
Dynamics NAV Server.
Web service Not supported. New object type that are designed by
creating or reusing a page or page and
codeunit objects together.
XMLports can be used to send complex
data to a Web service by making the
XMLport a parameter to a codeunit and
including that codeunit in a Web service.
Published by adding public references to
the Web Service table.
XMLport Same as previous versions of Microsoft Designed and executed in the same way as
Dynamics NAV. the Classic client.
The functions for using XMLports as XMLports have been extended with similar
dataports are not available. functionality to dataports to allow import
and export of structured files.
10
11
12
13
Web Services
14
To make a simple codeunit-based Web service in Microsoft Dynamics NAV ―6.0‖, you write a codeunit
object and then add that object to the Web Service table.
16
Run Form
Forms.xml Transformation Pages.xml
Database
Tool
Log file
Transformation
input files
You first map every form in the application to one of the new page types that have been defined for
the three-tier architecture. For every form that you want to transform to a page, you must specify if the
form is a card type, list type, document type, FactBox type, and so on.
17
Statistics Forms
Statistics forms that contain more than two columns must be adjusted before they can be transformed
correctly. To transform to a page, the columns must be grouped in a matrix, and the all cells in the
page must be filled. You must add a placeholder control to empty cells to fill the space.
It may be more useful to redesign some statistics forms as reports, because statistics forms are
generally used for data analysis.
18
Matrix Forms
The RoleTailored client does not support matrix controls. You can map a matrix control on a form to a
grid control on a page, but there are the following limitations to this approach.
You must make a new request page that will be used to define the filters and selections that should
be applied and a button to show the result in the grid.
The grid is read-only, and you cannot make grids or matrix forms in the RoleTailored client that are
used for data entry.
The grid contains a finite number of columns. The default value can be changed if you need a
larger grid but will always be static for that page.
19
20
To Use a COM Component to Carry Out External Processing, Such as Call a Web Service
With C/AL code running on Microsoft Dynamics NAV Server, you use the CREATE function to create an
automation object and then call a method on the object. When the method is run, any return value is
passed back to the code.
To ensure that this works correctly, the COM DLL must be stored and registered on the computer that
is running Microsoft Dynamics NAV Server.
21
22
23
This approach does introduce some complications for writing and maintaining the code:
It reduces how easy the code is to read, understand, and maintain. You may need to maintain and
keep code synchronized in multiple places. Reports and code that use automation objects and files
are different between the two platforms. For example, Office integration style sheets function
differently in the Classic client and RoleTailored client. Writing and maintaining code for style
sheets requires work in two formats and understanding for how particular style sheets should be
applied to the different clients.
It increasing testing needs, because code will need to be tested with multiple clients to ensure that
it functions correctly.
Both clients use the MenuSuite object for navigation, but the design is implemented differently. In
the Classic client, a user opens a card and then can jump to a list. In the RoleTailored client, a user
is presented with a list and can then select which page (card) to open. Supporting both design
types in Microsoft Dynamics NAV increases the work to understand and maintain changes.
Both clients have different implementations of the feature that is used to record miscellaneous
notes or comments about a document or contact. The Classic client uses comments, and the
RoleTailored client uses notes. Both features provide similar functionality, but different users are
not able to see the information that is entered by another user who uses a different client.
24
25
2. In Page Designer, add a new line, VIP Code, to the Customer List group. This adds a new column to
the Customer List page. Place the VIP Code line relative to where you want the column to be
shown in the list.
3. To define the properties for the new element that you have added to the page, open the
Properties window for the VIP Code line.
4. Set SourceExpr to VIP Code. The VIP Code field is in the Customer table, which is the source table
for the Customer List place.
5. Save and compile the modified page. When you compile the page, the system is updated, and a
RoleTailored client that connects to the database reads the updated page object.
6. Open the RoleTailored client and open the Customer List place to see the new VIP Code column.
26
27
3. In Page Designer, add a new field to General Customer Group by inserting a row in the appropriate
position.
4. Open the Properties window and set the VIP Code field in the Customer table as the SourceExpr
for the new VIP Code control in the Customer Card page. The Customer table is also the source
table for the Customer Card page.
28
29
30
2. Open the Properties window for the Sales Line data item. Set the DataItemLinkReference property
to the name of the parent data item (Customer) to which the indented data item (Sales Line) must
be related. In most cases, this is the default setting.
3. Set the DataItemLink property to point to the Sell-to Customer No. field from the Sales Line table.
In the Reference Field, select the No. field from the Customer table.
4. In the Properties window for the VIP Code data item set the DataItemLink property to point to the
VIP Code field. In the Reference Field, select the No. field from the Customer table.
5. In the Properties window for the Customer data item, set the PrintOnlyIfDetail property to Yes. This
ensures that the Customer body sections are only printed if there is data to print from the Sales
Line table.
The data model then works in the following way:
The report runs through the Customer data item.
31
If you create sections in Report Designer, all fields that you add to these sections are displayed in
the new report layout. Furthermore, all the fields included in the primary key of the tables that are
used as data items in the report are displayed in the new report layout.
32
33
You have now specified that you want the report to sort the sales line for each customer by their
shipment date.
To Add a Subtotal
You can also add aggregate functions to your report in Visual Studio.
1. Add a row below the Sales Line row.
2. In the last cell in this new row, add the following expression:
=Sum(Fields!Sales_Line_Amount.Value)
This calculates the total amount ordered by each customer.
34
4. When you are done with the report layout, save and close the project.
5. In the Classic client, when you open this report in Report Designer, a message appears informing
you that the .rdlc file for this report has changed and asks you if you want to load the changes.
Click Yes to save the changes in the database.
6. Compile the report.
The database now contains two versions of this report:
C/SIDE version that can be displayed in the Classic client.
SQL Server Reporting Services version that can be displayed in the RoleTailored client.
Important If you want to further modify the design of the report, you must open the report in the
C/SIDE Report Designer and click View, Layout. If you click Tools, Transform Layout, then you will
convert the original C/SIDE version of the report again and will not be able to see the changes that
you have already made.
Also, the C/SIDE Report Designer and Visual Studio are not closely integrated. Any changes made
in one environment will not be visible in the other environment if performed independently. You
must save any changes that you make in either development environment and import or export
the changes in the other environment before they will be visible there.
35
Forms
The following properties and functions are not supported in pages and are removed when using the
Form Transformation Tool to generate a page from a form. All code and properties that are removed
are recorded in the Transaction.log output file.
Form Properties
To be added when finalized
Report Functions
To be added when finalized
Reports
The following properties and functions are not supported in reports for the RoleTailored client:
Report Properties
BottomMargin
DeviceFontName
HorzGrid
LeftMargin
Orientation
PaperSize
PaperSourceFirstPage
PaperSourceOtherPages
RightMargin
ShowPrintStatus
TopMargin
VertGrid
Report Functions
NewPagePerRecord
ObjectID
URL
36
Report Triggers/Functions
Section triggers
Layout-specific functions and totaling functions
Unsupported functions referred to from other objects (codeunits, tables, and so on)
37
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of
publication. Because Microsoft must respond to changing market conditions, this document should not be interpreted to be a commitment on the
part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.
This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE
INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document
may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this
document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.