Skip to content
Microsoft Dynamics 365

Design Pattern: Observer

Microsoft Dynamics NAV has the built in ability to track all record changes against any table, however it does not always fire the triggers for every table. But with the Observer pattern, you can track all record changes against a defined table or set of tables. This pattern is a good example of how classic...

Read more

NAV Design Pattern: Activity Log

The Activity Log pattern tracks execution of activities. This is a Dynamics NAV specific implementation of the generic Audit Log pattern. In general, integrating with external systems can be very challenging, due to the complexity of the situation – connectivity issues, asynchronous operations, user errors, etc. These challenges require sometimes re-trying several times, polling the...

Read more

Design Pattern: Argument Table

The Argument Table pattern is used to provide an extension point for adding new arguments to a function without changing the signature. By grouping multiple arguments in a table, the code becomes more readable (the signature and the usage of the function). For the full description of this pattern, see the NAV Design Patterns wiki page....

Read more

NAV Design Pattern: Variant Façade

The Variant façade provides a single interface that can take any Record, RecordRef or RecordID as an argument. With this pattern, the code is encapsulated within the single object, with clear separation between common and table specific code. For the full description of this pattern, see the NAV Design Patterns wiki page....

Read more

NAV Design Pattern: TryFunction – .NET Exception Handling in C/AL

When you want to use objects from the .NET Framework in C/AL code, one of the main challenges is to handle exceptions that the methods of these objects may throw. Eventually, if not handled, they will basically bubble up as runtime errors, halting the current operation a user is doing without having a chance to properly...

Read more

Application Design Pattern: Report Selection

From the PRS workshop at NAVTechDays 2014, this pattern was written by 2 work groups: Group 1: Dale Gauci & Kimberly Congleton Group 2: Jens Winberg, Tim Grant, Alen Tot Thanks to Tim Grant for merging the two patterns, correct, send for review, and finalizing them! Meet the Pattern It should be possible to change...

Read more

NAV Design Pattern: Using C/AL Query Objects to Detect Duplicates

This pattern uses queries to create an efficient way to detect duplicate entries in a table. This is, for example, useful when trying to find out which customers or contacts have the same names, so we can merge them later. Description Duplicate detection has several requirements in Microsoft Dynamics NAV. One method to eliminate duplication...

Read more

New Application Design Patterns: Totals and Discounts on Subpages

To increase discoverability and productivity, critical information, such as statistics, can be moved from separate pages onto the document where it is needed. For example, documents should clearly display totals and discounts information to provide quick overview, make it easy to relate the amounts to the document currency, and to allow the user to see...

Read more

Reusable Bugs

Here at Microsoft we strive to create reusable and generic solutions, in order to improve efficiency and ship better software. We had revisited some of our best practice principles and had turned them upside down to get a better and more complete view on development in general. Description It widely known that bugs are unfortunately...

Read more

Error Message Processing

Do you remember when, a year and a half ago, at NAV Tech Days, you gave us feedback on the NAV Design Patterns session – saying that Journal Error Processing is not generic and decoupled enough? Well, my colleagues Andreas Moth and Jesper Schulz from the NAV localization team at Microsoft Development Center Copenhagen, had...

Read more