While talking about design patterns, we often came upon a different category of code solutions. Useful, reusable, good practice code solutions which are just not design patterns. They might be APIs, they might be mini-features, new platform functionality, or services.
We don't want to throw away those good ideas. On the other side, they do not belong to design patterns.
Hence, a chapter called “Recipes - The NAV C/AL Cookbook” was born, as a separate section on the Dynamics Community NAV Patterns Wiki. We hope you’ll find it as useful as we did. And find below one of the first articles on this new section. Note that we’re still using the “Meet the pattern - Know the pattern” format, just to keep an uniform approach on all articles, for the moment.
by Nikola Kukrika at Microsoft Development Center Copenhagen
The goal of this pattern is to enable you to:
This pattern enables you to implement a business chart (Specific Chart type) in a way that is maintainable and reusable on other pages. This also enables you to provide specific functionality that is not possible with the Generic Chart type and it enables you to show charts in the web client.
Example of the same chart in the Microsoft Dynamics NAV Windows client:
The most obvious differences in chart rendering in the two clients are: Slightly different line heights, slightly different chart height, legends in web-client charts can be used as toggle filters to show/hide groups (this is not possible in the win client).
This table is used to encapsulate the logic of the Business Chart Add-in. The table handles the following logic:
Note: It is recommended that you reuse the Business Chart Buffer table (485) as a buffer table or extend. It is a generic table which should cover most of the use cases. Implement a new buffer table only if this table does not meet your needs.
The CardPart page hosts the Business Chart add-in and must use the add-in buffer table as a source table.
On the page, you must implement the following triggers:
The CardPart usually contains a StatusText variable to provide more information about the chart or dataset and a set of actions to control the chart.
The most commonly used actions are: ... Read more on NAV Wiki...
We always strive to make Microsoft Dynamics NAV a better product – and in order for us to do that efficiently we need to know how real customers out there are using the product. To help us getting that knowledge, Microsoft Dynamics NAV Server can send anonymous data about how server instances are configured and used.
You may have noticed the following option when installing Microsoft Dynamics NAV Server:
Setting this to ‘Yes’ makes the server generate a small file every day at midnight, and this file gets uploaded to Microsoft. The generation of this file happens asynchronously and is designed so that the performance impact is completely negligible. Furthermore, data is sent when the service is stopped.
The collected data points fall in 3 categories
We want to stress that we do not send any customer / partner specific data, and we have no way of finding out which company sent certain data. We only collect information about Microsoft Dynamics NAV objects that are part of the standard application, and we do not read or send any business data.
So how is this useful to us? Identifying the pages and reports that are most used allows us to prioritize improvements to these higher than others. For example, knowing the Windows versions that are in use gives input to our system requirements and support matrix.
Over time we will change and expand the data collected to evaluate the success of new features, so the actual data sent may vary between versions.
The data sent is only useful if we have statistically significant amounts to make valid conclusions, so you can help us by having your customers participate in the Customer Experience Improvement program. This can be done by selecting ‘Yes’ in the Send Feedback question when installing the server, or by setting the following value to true in the configuration file for the service:
When this parameter is set to TRUE, Microsoft Dynamics NAV Server collects basic information
about your hardware configuration and how you use Microsoft Dynamics NAV software.
Microsoft uses this information to identify trends and usage patterns. When this parameter is
set to FALSE, no data is collected. The default value is FALSE.
<add key="EnableSoftwareQualityMetrics" value="false" />
Please help us making the right choices when developing Microsoft Dynamics NAV by encouraging your customers to allow sending feedback to us from their deployments.
For more information, see the Microsoft Dynamics NAV Privacy Statement.
The Dynamics NAV team
Convergence 2014 Europe is a Microsoft Dynamics customer event and the best opportunity to expand your professional network, explore Microsoft solutions, and bring new ideas to life. Even better, if you register early, you'll save €300.
Whether you are new to Convergence or have attended in the past, there are many benefits to going: networking, learning opportunities, visionary business leaders and access to product experts. As a user of Microsoft Dynamics NAV you will have the opportunity to explore what is new in the coming version code named Microsoft Dynamics “Crete”. Convergence Europe is held in Barcelona November 4-6. Explore more on the event web site: http://www.microsoft.com/dynamics/convergence/europe14/
In earlier versions of Microsoft Dynamics NAV, you could move or copy all or part of the data in a database by using the Microsoft Dynamics NAV backup functionality. In Microsoft Dynamics NAV 2013 R2, the support for the .fbk files was removed, but with Cumulative Update 8 for Microsoft Dynamics NAV 2013 R2, we introduce Windows PowerShell cmdlets so you can export data from a Microsoft Dynamics NAV database and import it into another Microsoft Dynamics NAV database. You can also export and import data in the Microsoft Dynamics NAV Windows client.
You can export and import a single company or all companies in a database, and you can export and import other types of data such as global data, application data, and application objects. As part of Cumulative Update 8, we include a whitepaper that provides examples of the types of data and how to export and import data using Windows PowerShell cmdlets as well as in the Microsoft Dynamics NAV Windows client.
When you export data from a Microsoft Dynamics NAV database, the data is stored in a file with the extension .navdata, which is a new file format that is proprietary to Microsoft Dynamics NAV data. You cannot edit the .navdata files in other tools.
The data that you export is not deleted from the original database. So that means that you can use the functionality to essentially take a copy of your customer’s live data, leave them to continue working, while you import the data into an offline database back at your office for further debugging or other investigation. You can also use the .navdata files to move data to a new database, such as moving a company to a new database when you want to deprecate a database, for example.
To export or import data, in the Search box, enter Data File, and then choose the related link.
To export data, you specify the type of data that you want to export, and when you choose the OK button, you specify where you want to save the file.
To import data, you specify the .navdata file to import data from, but you can't import an application if the .navdata file contains an application. This is because you can't overwrite the application that is currently open in the Microsoft Dynamics NAV Windows client. So the window has one less type of data that you can choose to import:
If you want to import an application into a Microsoft Dynamics NAV database, you must use the Import-NAVData Windows PowerShell cmdlet.
The following table describes the Windows PowerShell cmdlets that are new in Microsoft Dynamics NAV 2013 R2 Cumulative Update 8.
Exports data from a Microsoft Dynamics NAV database. You can export company-specific data, and you can choose to include global data, application data, or application objects.
Imports data into a Microsoft Dynamics NAV database from a file. You can import all data in the file, or you can choose to include specific companies, global data, application data, or application objects.
You can only import an application into an empty database.
Gets information from a file that has been exported from a Microsoft Dynamics NAV database.
The extracted information includes the types of data that the file contains and any company names.
The cmdlets take different parameter sets depending on how you connect to the database that you want to export data from or import data into. You can access the database through the Microsoft Dynamics NAV Server instance, or you can access the database directly as described in the following table.
Through the Microsoft Dynamics NAV Server instance.
Use parameter sets that include –ServerInstance when the database that you want to access is mounted against a Microsoft Dynamics NAV Server instance.
The user account for the Microsoft Dynamics NAV Server instance must have access to write to the location that is specified by the –FileName parameter.
Through a direct connection to the database.
Use parameter sets that include –DatabaseServer and –DatabaseName when the Microsoft Dynamics NAV Server instance is stopped or not available. For example, if you want to import an updated application into a database, you stop the service so that users cannot access the database.
You must have access to write to the location that is specified by the –FileName parameter.
The following table describes the Windows PowerShell cmdlets that are modified in Microsoft Dynamics NAV 2013 R2 Cumulative Update 8.
Gets a list of the Microsoft Dynamics NAV companies in the specified tenant database or exported Microsoft Dynamics NAV data file.
The cmdlet has been updated to be able to get information from a Microsoft Dynamics NAV data file.
However, the Help for the Export-NAVData and Import-NAVData Windows PowerShell cmdlets does not show the correct syntax when you run a command such as the following:.
PS C:\WINDOWS\system32> Get-Help Export-NAVData
Refer to the following syntax for the Export-NAVData cmdlet:
Refer to the following syntax for the Import-NAVData cmdlet:
You can find more information about this functionality, and the new or changed objects, in the following documents on the W1 version of the Microsoft Dynamics NAV 2013 R2 CU8 download media:
In subsequent cumulative updates, the documents will be available in the country-specific downloads as well.
Meet the Pattern
To mitigate usability problems with learnability or discoverability of Microsoft Dynamics NAV functionality, it is possible to embed instructions in the user interface (UI) in connection with the task that the user is performing. The goal is to explain how to use the product or feature without impairing the user’s productivity after user has learned how to use a feature.
Know the Pattern
Users must often go through a few days of training to learn how to use Microsoft Dynamics NAV, and even then, many users rely on super users to help them mitigate difficulties using Microsoft Dynamics NAV. In addition, because of low discoverability and learnability, many useful features are not being used at all.
Users’ expectations are changing. They expect the software to be usable out-of-the-box because this is the trend in software generally.
One of the cheapest and most effective methods to solve usability issues is to embed instructional messages in the product. From a user-experience point of view, this should be used as a last resort. UI should be self-explanatory, efficient, and simple to use. Accordingly, you should only implement this pattern if simplifying and improving a scenario is not possible or is too expensive.
In this connection, the most important requirement is not to impair productivity of the users. One of the biggest and most common UX mistakes that developers make is to “optimize for new users”. After the user has learned how to use the product, all the instruction texts and dialogs that we added to the UI will clutter the page and make information less visible. Instructional dialogs on routine tasks will become annoying. Therefore, we must make all instructions dismissible.
In the Mini App solution we have used following elements:
Use the Pattern
The following pattern applies to dismissible parts in the UI.
We have a table that stores the instructional code ID and the UserID, so that we can track which user has turned off which instruction. All the logic handling is done from a codeunit. It is the responsibility of the codeunit to show/hide dialogs if needed.
Dismissible dialogs show the instructional message about the functionality, with the user option to... read more on the NAV Design Patterns wiki.
Nikola Kukrika at Microsoft Development Center Copenhagen
Cumulative update 15 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013. The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:
You can download cumulative update 15 from KB 2971745 – Cumulative Update 15 for Microsoft Dynamics NAV 2013 (Build 36919).
For a full list of all hotfixes included in the cumulative update, see the following CustomerSource and PartnerSource pages:
For more information about cumulative updates for Microsoft Dynamics NAV 2013, see Announcement of update rollups for Microsoft Dynamics NAV 2013.
Cumulative update 8 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013 R2.
The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:
Cumulative update 8 also introduces new functionality for exporting and importing companies and other data. You can export a company from a Microsoft Dynamics NAV database and import it into another database, and you can export and import other types of data such as global data, application data, and application objects.
In earlier versions of Microsoft Dynamics NAV, you exported and imported this type of data as part of backing up and restoring databases. In Microsoft Dynamics NAV 2013 R2 CU8, you can do this by using the Export-NAVData and Import-NAVData Windows PowerShell cmdlets. You can also import and export data in the Microsoft Dynamics NAV Windows client.
For more information, see the following documents on the W1 version of the Microsoft Dynamics NAV 2013 R2 CU8 download media:
Please note that there is very limited support for exporting and importing data in the Microsoft Dynamics NAV Web client. Use the Microsoft Dynamics NAV Windows client or the Windows PowerShell cmdlets instead.
You can download cumulative update 8 from KB 2971746 – Cumulative Update 8 for Microsoft Dynamics NAV 2013 R2 (Build 36897).
For a full list of all hotfixes included in cumulative updates for Microsoft Dynamics NAV 2013 R2, see the following CustomerSource and PartnerSource pages:
For more information about cumulative updates for Microsoft Dynamics NAV 2013 R2, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2.
This week, the pattern is familiar to most C/AL developers, but if you are new to Microsoft Dynamics NAV, or if you need a refresher, here is the pattern behind journal templates, batches, and lines.
The role of a journal line is to temporarily hold transaction data until the transaction is posted. Before posting, the entries are in a draft state, which means that they are available for corrections and/or deletion. As soon as the entries are posted, they are converted to ledger entries.
Journal templates are used to specify the underlying journal structure and to provide the default information for the journal batches. Journal batches usually serve to group journal lines, such as lines created by two different users.
Journal templates and journal batches are used if there is a need to create and post one or more entries. They are implemented in multiple areas of the application, like Sales, Purchases, Cash Receipts, Payments, Fixed Assets1.
The journal templates are located on the Journal Template page. A Journal Template definition contains a series of attributes, such as:
The Journal Template table stores the relevant attributes that define the nature and behavior of the journal templates, for example:
Journal Template Table Field
Test Report ID
The journals offer the possibility of running test reports3. The role of a test report is to simulate the posting process. The verification criteria for the journal lines is ran, and the report can be displayed, all without doing the actual posting. This helps finding and correcting any errors that might exist in the data.
The name of the test report is the same with the name of the corresponding journal, plus the suffix " - Test". For example, the General Journal has the associated test report named General Journal - Test.
Posting Report ID
This report is printed when a user selects Post and Print4.
For some journals, more UI objects are required. For example, the General Journals have a special page for bank and cash.
Here you can enter a Trail Code for all the postings done through this Journal4.
Whenever you post lines from a recurring journal, new lines are automatically created with a posting date defined in the recurring date formula.
Each journal template defines a default value of those attributes. The values that are defined in a template will be inherited by the journal batches, which will be created from a journal template.
Microsoft Dynamics NAV is released with a number of standard journal templates predefined in the Journal Templates page. More templates can be defined by the users.
Journal batches are created with the help of the journal templates.
A journal batch is typically used to make a distinction between collections of logically grouped journal lines. A typical design is to have a journal batch for each user who enters lines. The batches are used during the posting process, in order to post one or multiple lines at once.
Journal lines contain the actual business data (posting dates, account numbers, amounts) that will be posted as ledger entries.
During posting, only the information from the journal lines is needed. However, the information has been created with the help of the journal templates and grouped together using the journal batches.
Posting creates ledger entries from the temporary content that is stored in the journal lines. Ledger entries are not created directly. Instead, they are posted from journal lines.
There is a 1:n aggregation relationship between journal templates and journal batches, as well as between journal batches and journal lines. Deleting a template will cascade deletion of the related batches and lines. Deleting a batch will cascade into deletion of related lines.
Read more on NAV Patterns Wiki...
Bogdana Botez at Microsoft Development Center Copenhagen
This pattern shows a solution for integrating W1 features to pre-existing country features that use different tables to achieve similar functionality.
It sometimes happens that certain features are requested in a country/region that is supported by Microsoft, but they are not initially considered generic enough to be included in the W1 build. This is how local features, such as Subcontracting in Italy and India, were created or specific banking and payments functionality in Italy, France, Spain, and others.
Then, at some point in time, a decision is made to create a W1 feature that is closely related to the local functionality but uses a completely different set of tables, pages, etc. The developers now face the following problem: How to enable the newly-developed W1 feature into a country, such that the customers who are accustomed to their local structures can seamlessly continue working without completely (or immediately) switching to the W1 objects.
This was the issue that was tackled in the Microsoft Dynamics NAV 2013 R2, in relation to the SEPA Credit Transfers functionality.
The generic Proxy pattern is "a class functioning as an interface to something else" (Wikipedia).
Figure 1. Proxy in UML
The Microsoft Dynamics NAV data model translation of the proxy pattern can be used as explained below.
In the diagram, RealSubject is the Microsoft Dynamics NAV data model. Variations in table structures, relationships, and numbers are particular to each country. The W1 model is the base for the localized data models. However, some countries have heavy localizations which cannot be directly processed by the W1 core objects.
The proxy is a codeunit that gathers data from wherever it is stored and transforms it to fit into a standard table, which is later used across all localizations.
The interface is the fixed form in which the data is presented to be consumed by the client.
The client can be an XML port that is fed from the common data interface. It can also be any other data processor (a codeunit fed to another table, etc.) or data display object (page or report).
In Microsoft Dynamics NAV 2013 R2, Continue reading on NAV Patterns Wiki...
Bogdan Sturzoiu at Microsoft Development Center Copenhagen