Development changes

Dynamics NAV 2013 introduces several development changes. There are changes regarding the development environment, with new features and object properties, and changes in the standard C/AL code, which has been redesigned in some areas.

Development Environment

Development Environment is the former Dynamics NAV classic client. In previous versions, the classic client was used both as an application client for end users and for development purposes. With Dynamics NAV 2013, the classic client is no longer available as an application client but has remained as the development environment. That is why it has been renamed to Microsoft Dynamics NAV Development Environment.

The development environment in Dynamics NAV 2013 introduces several improvements, including:

  • New object types
  • Enhancements on the development of object types that existed on previous versions
  • New features
  • New object properties
  • Better .NET interoperability

Debugging

Microsoft Dynamics NAV 2013 introduces a brand new debugger. Debugging will no longer be a painful task in Microsoft Dynamics NAV. Conditional breakpoints, debug other user sessions, and debug C/AL code in the Windows client instead of incomprehensible C# code are the new features, which will convert the debugging experience into a happy experience.

With the new debugger, you can now debug the following sessions:

  • Microsoft Dynamics NAV Windows client sessions
  • Microsoft Dynamics NAV SharePoint client sessions
  • Microsoft Dynamics NAV Web client sessions
  • OData web services sessions
  • SOAP web services sessions
  • NAS services sessions
  • Background sessions that you start by using the STARTSESSION function

You will find more information about the new debugger in Chapter 11, Debugging.

Page development

Page development is easier with Dynamics NAV 2013 than it was with Dynamics NAV 2009. Several enhancements have been added to the Page Designer page, as follows:

  • Page Preview in Page Designer: Dynamics NAV 2013 introduces Page Preview. A page can be previewed without having to run the page in the client. It is an interactive preview. As we move through the page controls and page actions on the Page Designer page, the corresponding element on the rendered page will be highlighted in a blue rectangle. To preview a page, click on the Preview button available on the Page Designer page.
  • Page Field arrangement in a Grid: There is a new page control in Dynamics NAV 2013 called GridLayout. With this control, fields can be laid out in rows and columns. The following screenshot shows GridLayout page control defined on the Page Designer page and what it looks like on the corresponding page:
    Page development
  • Standard Dialog page type:This is a new page type that can be used to create simple pages for entering data. The Standard Dialog page does not include a ribbon and cannot be customized on the Windows client.
  • Page wizard: Dynamics NAV 2013 includes a page wizard to easily create pages. With the page wizard, we can select fields on a table to be displayed on the page, we can create tabs to arrange the fields, and we can add subpages, FactBoxes, and charts.
  • Action and Activity button icon selection: We can now select an icon for an action or an activity from a list instead of manually entering the icon's name.
  • Default control names and captions: By default, the name and caption on a field control use the source field's name in the database.
  • Quick Entry property: We have explained what the Quick Entry property is and what it can be used for, in the Improvements to the Windows client section. This property can be set by a developer on the Page Designer page.

Page testing

Testing options were introduced with Dynamics NAV 2009 SP1. Dynamics NAV 2013 has gone further in testing and introduces the ability to test pages.

On a test codeunit, we can now create a new type of variable, TestPage.

Page testing

With this type of variable, we will be able to do with code almost the same things a user can do in a page. We will be able to:

  • View or modify the value of a field on a test page
  • View the data on page parts
  • View or modify the value of a field on a subpage
  • Filter the data
  • Perform any actions that are available on the page
  • Navigate to different records

Note

A set of tests that use this new feature is available for Dynamics NAV 2013: Application Test Toolset. With this tool, you will be able to do testing on most of the standard functionalities provided with Dynamics NAV. It is important to run those tests when developing for Dynamics NAV as we want to make sure our developments do not introduce bugs into standard Dynamics NAV functionality.

Application Test Toolset can be downloaded from the following link (requires access to PartnerSource):

https://mbs.microsoft.com/partnersource/deployment/resources/supplements/msdnav2013applicationtoolset.htm

A blog post from the Dynamics NAV development team explains how to use the tool and can be found at:

http://blogs.msdn.com/b/nav/archive/2012/11/07/application-test-toolset-for-microsoft-dynamics-nav-2013.aspx

Report development

Report development is completely different from what it used to be. The report development experience changed in Dynamics NAV 2009, with the introduction of RLDC-based reports, but it changes again with the actual release of the application.

With Dynamics NAV 2009, RLDC-based reports were introduced, but reports were still compatible with the classic definition of reports in Dynamics NAV. RLDC reports were actually based on the classic definition of the report.

With Dynamics NAV 2013, the classic definition for reports has disappeared and only RLDC-based reports are now available. But RLDC reports cannot now be based on the classic definition of reports. That is why the report development experience has changed again.

The report development experience in Dynamics NAV Development Environment now resembles the development experience of pages, queries, or XMLports. We now include, in the report designer, not only data items but also columns (fields) that will be displayed on the report.

Report development

The second part of report development, the development of the layout of the report, has to be done in Visual Studio 2010 (Dynamics NAV 2009 used Visual Studio 2008).

Reports in Dynamics NAV 2013 include a new function, SAVEASWORD, that enables you to save a report on the computer that is running Dynamics NAV Server as a Microsoft Word (.doc) document.

Reports in Dynamics NAV 2013 include three new properties to specify the printer tray from which pages of a report are printed. Those properties are as follows:

  • The PaperSourceFirstPage property
  • The PaperSourceLastPage property
  • The PaperSourceDefaultPage property

Query development

Microsoft Dynamics NAV 2013 introduces a new application object, the Query.

A Query is a read-only object that allows us to combine data from multiple tables into a single dataset using several SQL join types. Results in a query can easily be filtered, sorted, and grouped, and totals can easily be calculated using methods such as sum, average, or count.

You will find more information about this new application object in Chapter 12, The Query Object.

XMLport development

In the previous versions of Dynamics NAV, XMLports could not be executed directly. They had to be run from a codeunit. With Dynamics NAV 2013, we can now run XMLports directly from Object Designer. The XMLport will run on the Dynamics NAV server.

In previous versions, when using XMLports with the Import option, new records could be inserted but existing records could not be modified. XMLports now have a set of new properties, called AutoSave, AutoReplace, and AutoUpdate, to determine whether records are automatically inserted, replaced, or updated.

In the previous versions, XMLports could only import and export data in text format encoded with MS-DOS encoding format. With Dynamics NAV 2013, we can now specify whether to use the MS-DOS, UTF-8, or UTF-16 encoding formats.

Start ID Offset

When you add new elements to a Dynamics NAV object, such as new global or local variables, new functions and new controls in pages, you are automatically given an ID for that new element that always starts with the same ID.

When developing in Dynamics NAV, we usually identify changes for a specific solution using the object's version list and also using object and field numbering. However, we cannot use element numbering in standard objects to identify developments done for a specific solution. In Dynamics NAV 2013, that is now possible with Start ID Offset.

When we specify a Start ID Offset, for example 1000, all elements that we create will have an ID starting with 1000 and then incremented by 1. That is, the first element created on an object will have 1000 as ID, the second element will have 1001 as ID, and so on.

To specify a Start ID Offset, the following steps have to be performed:

  1. Open Dynamics NAV Development Environment.
  2. Click on File | Database | Alter.
  3. Select the Advanced tab.
  4. Specify the desired offset value in the Start ID (UidOffset) field.
    Start ID Offset

Changes to C/AL functions, data types, properties, and triggers

Dynamics NAV 2013 introduces new data types, functions, properties, and triggers. There are also some data types, functions, properties, and triggers that have changed or that have been removed.

The following table provides an overview of all the changed properties and their replacements:

Property

Type of change

Description of the change

AutoReplace

New

New property in XMLports

AutoSave

New

New property in XMLports

AutoUpdate

New

New property in XMLports

PaperSourceDefaultPage

New

New report property

PaperSourceFirstPage

New

New report property

PaperSourceLastPage

New

New report property

DrillDownFormID

Changed

Name changed to DrillDownPageID

CardFormID

Changed

Name changed to CardPageID

LookupFormID

Changed

Name changed to LookupPageID

RunFormLink

Changed

Name changed to RunPageLink

RunFormOnRec

Changed

Name changed to RunPageOnRec

RunFormView

Changed

Name changed to RunPageView

SubFormLink

Changed

Name changed to SubPageLink

SubFormView

Changed

Name changed to SubPageView

UseReqForm

Changed

Name changed to UseRequestPage

TransactionType

Changed

In Microsoft Dynamics NAV 2013, the default transaction isolation level is REPEATABLE READ. In earlier versions of Microsoft Dynamics NAV, it was SERIALIZABLE. This affects FIND and NEXT function calls when transaction type is Update, Snapshot or UpdateNoLocks.

BottomMargin

Removed

PaperSourceOtherPages

Removed

SaveTableView

Removed

The following table provides an overview of all the changed triggers and their replacements:

Trigger

Type of change

Description of the change

OnAfterModifyRecord

New

New XMLport trigger

OnBeforeModifyRecord

New

New XMLport trigger

OnCreateHyperlink

Removed

OnHyperlink

Removed

OnPreSection

Removed

OnPostSection

Removed

The following table provides an overview of all the changed data types and their replacements:

Data type

Type of change

Description of the change

BLOB

Changed

If you call the CALCFIELDS function (Record) on a BLOB field, you get the value of BLOB that is in the database, not the value that you wrote to BLOB OutStream.

Code

Changed

The Code data type supports Unicode. Limits are not enforced on the length of a Code variable.

Text

Changed

Text supports Unicode in Microsoft Dynamics NAV 2013. Limits are not enforced on the length of a Text variable. You can specify a maximum length in the C/AL Globals or C/AL Locals window when you create the variable, but it is not required.

Binary

Removed

Binary was used to store fixed lengths of binary data in a record. BLOB should now be used for this purpose.

The following table provides an overview of all the changed functions and their replacements:

Function

Type of change

Description of the change

SETAUTOCALCFIELDS (Record)

New

New function to calculate FlowFields at the same time that you retrieve them from the database

CURRENTEXECUTIONMODE

New

New function

STARTSESSION

New

New function

STOPSESSION

New

New function

CALCFIELDS (Record)

Changed

CALCFIELDS execution is decoupled from Microsoft Dynamics NAV SIFT index definitions

CALCSUM (FieldRef)

Changed

CALCFIELDS execution is decoupled from Microsoft Dynamics NAV SIFT index definitions

CALCSUMS (Record)

Changed

CALCFIELDS execution is decoupled from Microsoft Dynamics NAV SIFT index definitions

COUNT (Record)

Changed

The COUNT function does not always ignore security filters. It adheres to the SecurityFiltering property

COUNT (RecordRef)

Changed

The COUNT function does not always ignore security filters. It adheres to the SecurityFiltering property

CREATETOTALS

Changed

Redundant in Microsoft Dynamics NAV 2013 reports. We recommend that you use the SUM function in Visual Studio instead.

Debugger functions

Changed

New functions have been introduced

INSERT (Record) and INSERT (RecordRef)

Changed

You cannot call the INSERT function on a record for table 2000000001, the object table or table 2000000006, the company table

MODIFY (Record) and MODIFY (RecordRef)

Changed

Microsoft Dynamics NAV 2013 does not let you modify the database by using an old copy of a record. You cannot call the MODIFY function on a record for table 2000000001, the object table or table 2000000006, the company table.

DELETE (Record) and DELETE(RecordRef)

Changed

You cannot call the DELETE function on a record for table 2000000001, the object table or table 2000000006, the company table.

RENAME

Changed

Microsoft Dynamics NAV 2013 does not let you modify the database by using an old copy of a record.

FormHandler

Changed

Name changed to PageHandler

ModalFormHandler

Changed

Name changed to ModalPageHandler

ISSERVICETIER

Changed

Obsolete in Microsoft Dynamics NAV 2013, but still supported. This function always returns true.

RECORDLEVELLOCKING (Record and RecordRef)

Changed

Not used in Microsoft Dynamics NAV 2013. The function is still available and compiles, but always returns true.

READCONSISTENCY (Record and RecordRef)

Changed

Not used in Microsoft Dynamics NAV 2013. The function is still available and compiles but because Microsoft Dynamics NAV 2013 uses SQL Server's locking mechanisms and does not use snapshots like earlier versions of Microsoft Dynamics NAV did, the return value is always false.

SETCURRENTKEY (Record)

Changed

In Microsoft Dynamics NAV 2013, you do not have to define keys only for SIFT indexes. Fewer SIFT indices and fewer Microsoft Dynamics NAV keys can improve performance.

BEEP

Removed

COMMANDLINE

Removed

COUNTAPPROX

Removed

ENVIRON

Removed

EXPORT (BLOB)

Removed

EXPORTOBJECTS

Removed

Not supported in Microsoft Dynamics NAV 2013. Use the finsql.exe executable with the ExportObjects command instead.

IMPORT (BLOB)

Removed

IMPORTOBJECTS

Removed

Not supported in Microsoft Dynamics NAV 2013. Use the finsql.exe executable with the ImportObjects command instead.

LANGUAGE

Removed

NEWPAGE

Removed

NEWPAGEPERRECORD

Removed

OBJECTID

Removed

OSVERSION

Removed

PAGENO

Removed

PAPERSOURCE

Removed

SAVEASHTML

Removed

SAVEASXML

Removed

SETPERMISSIONFILTER (Record)

Removed

Not supported in Microsoft Dynamics NAV 2013. Instead, you change the SecurityFiltering property from Validated to Filtered.

SETPERMISSIONFILTER (RecordRef)

Removed

Not supported in Microsoft Dynamics NAV 2013. Instead, you change the SecurityFiltering property from Validated to Filtered.

SHELL

Removed

SHOWOUTPUT

Removed

SYNCHRONIZEALLLOGINS

Removed

SYNCHRONIZESINGLELOGIN

Removed

TOTALSCAUSEDBY

Removed

URL

Removed

VARIABLEACTIVE

Removed

YIELD

Removed

The following table provides an overview of all the changed objects and their replacements:

Objects

Type of change

Description of the change

The Query object

New

New object type

Test Pages

New

New objects and functions

Dataports

Removed

Forms

Removed

The RequestOptionsForm system variable

Removed

.NET interoperability

Dynamics NAV can be extended with the .NET Framework assemblies. We can reference assemblies and call types directly from C/AL code of Dynamics NAV objects, such as pages and codeunits. Dynamics NAV objects can also subscribe to events that are published by .NET Framework types.

Enhancements in RoleTailored client control add-ins

Control add-ins has been enhanced with the following features:

  • Additional data types are supported with database binding: Dynamics NAV 2013 now supports data types, such as DateTime, Boolean, Char, Decimal, Int32, Int64, and Guid. Data binding and firing of the OnControlAddIn C/AL trigger is enabled by implementing respective interfaces.
  • Methods and properties can be exposed to C/AL code: To extend user interface controls on a page, methods and properties can be exposed in a control add-in assembly so that they can be called by C/AL code on page triggers.
  • Control add-ins can be sized: We can now specify an area of a page that a control add-in occupies both with a fixed size or by setting the control add-in to resize as the page window resizes in the Dynamics NAV Windows client.

Standard C/AL code redesign

Standard Dynamics NAV C/AL code has been redesigned in Dynamics NAV 2013 to use some new development functions introduced with this release of the application and to make the application faster.

G/L Entry table locking redesign

The sales, purchase, and service posting routines of Dynamics NAV 2013 have been redesigned to lock differently from how previous versions of Dynamics NAV locked.

In previous versions, posting routines used to lock the G/L Entry table at the very beginning of the transaction. That meant that a user could not initiate a posting transaction while another posting transaction was being executed. This was a huge performance issue in multiuser environments.

Dynamics NAV 2013 sales, purchase, and service posting routines have been redesigned to lock the G/L Entry table later on, when the lock is really needed. Thus, the time for which this table remains locked is shorter than in previous versions, letting multiple users execute a posting routine at the same time and thus improving performance in multiuser environments.

Storing dimension entries

With Dynamics NAV 2013, the dimension feature has been redesigned. From the user's point of view nothing has changed; dimensions still work as they used to, and they are used for the same purposes.

But the way dimensions are stored in the database has been completely redesigned. Instead of explicitly storing each dimension value in the database, a dimension set ID is used, and all the tables that use dimensions (documents, journals, entries, and so on) now refer to the same dimension set ID. This way, a dimension set is stored only once in the database, reducing the database space required to store dimensions and improving the application's overall performance. A new table called Dimension Set Entry has been created. Dimension set IDs are then assigned to journal lines, documents headers, and document lines.

Dimension sets

A dimension set is a unique combination of dimension values. It is stored as dimension set entries in the database. Each Dimension Set Entry table represents a single dimension value. The dimension set is identified by a common dimension set ID that is assigned to each Dimension Set Entry table that belongs to the dimension set.

Dimension set entries

Dimension sets are stored in the Dimension Set Entry table as dimension set entries with the same dimension set ID.

Dimension set entries

When you create a new journal line, document header, or document line, you can specify a combination of dimension values. Instead of explicitly storing each dimension value in the database, a dimension set ID is assigned to the journal line, document header, or document line to specify the dimension set.

When you edit and close the Edit Dimension Set Entries window, a check is performed to see whether the combination of dimension values exists as a dimension set in the table. If the combination occurs in the table, the corresponding dimension set ID is assigned to the journal line, document header, or document line. Otherwise, a new dimension set is added to the table, and the new dimension set ID is assigned to the journal line, document header, or document line.

Performance improvement

By storing dimension sets once in the database, database space is preserved and overall performance is improved.

ADCS

The implementation of Automated Data Capture System, known as ADCS, was implemented in previous versions of Dynamics NAV using NAS services. In Dynamics NAV 2013, the implementation of ADCS is now based on web services. The user experience remains the same.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset