Microsoft Dynamics NAV

Team Blog

  • Microsoft Dynamics NAV Team Blog

    Using the Microsoft Dynamics NAV 2015 Web Client without Internet Access

    • 1 Comments

    As you know, the Microsoft Dynamics NAV 2015 Web client is a website that you deploy and which your users can access from any browser. But in some businesses, users do not have Internet access, but they still want to be able to access Dynamics NAV from a browser. So how can you configure the Dynamics NAV Web client to not require Internet access? Well, you will have to change the configuration in Internet Information Services (IIS) Manager. Here are the steps for how to do this.

    1. Download the following two files:
    2. Open IIS Manager, locate the Microsoft Dynamics NAV 2015 Web client instance that you want to modify, expand it, right-click the Resources folder, and then choose Explore.
    3. Copy your downloaded, local versions of jquery-1.9.1.min.js and jquery-ui.min.js to the Resources folder.
    4. In Windows Explorer, navigate to the WebClient folder, and then open the default.master file in Notepad.
    5. Locate the following line:
      <Web:NoScriptControl runat="server" NoScriptTargetPage="DisabledJavaScript.aspx"/>

      After this line, add the following two lines:
        <script src="Resources\jquery-1.9.1.min.js" type="text/javascript"> </script>
        <script src="Resources\jquery-ui.min.js" type="text/javascript"> </script>

      The following snippet illustrates the result:

      <body class="v4master" scroll="no" id="formBody">
        <Web:NoScriptControl runat="server" NoScriptTargetPage="DisabledJavaScript.aspx"/>
        <script src="Resources\jquery-1.9.1.min.js" type="text/javascript"> </script>
        <script src="Resources\jquery-ui.min.js" type="text/javascript"> </script>

        <form id="aspnetForm" runat="server">
          <asp:ScriptManager runat="server" EnablePartialRendering="false"/>
          <asp:ContentPlaceHolder ID="BodyPlaceHolder" runat="server" ClientIDMode="Static"></asp:ContentPlaceHolder>
          <asp:ContentPlaceHolder ID="PHM" runat="server" ClientIDMode="Static"></asp:ContentPlaceHolder>
        </form>
    6. In the Dynamics NAV Windows client, open the "Control Add-ins" page.
    7. Select Microsoft.Dynamics.Nav.Client.BusinessChart, and then choose Export.
    8. Save the zip file locally and unzip the files.
    9. Open the manifest.xml file and find the ScriptUrl tag :
      <ScriptUrl>https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js</ScriptUrl>
      Change this line to the following:
      <ScriptUrl>Resources/jquery-1.9.1.min.js</ScriptUrl>
    10. Zip the folder again and import it back in the Control Add-ins page.
    11. In IIS Manager, restart the Dynamics NAV Web Client website.

    Please note that after these changes, this Dynamics NAV Web client instance will no longer be able to access the latest versions of the two query scripts.

     

    Gedas Busniauskas 

    Microsoft Dynamics NAV Support Engineer

  • Microsoft Dynamics NAV Team Blog

    Application Design Pattern: Report Selection

    • 0 Comments

    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 which document report object should be used when printing. This configuration can be stored in one place (Report Selection) and available at configuration time. In this situation, the code for printing records can remain the same.

    The purpose of this pattern is to describe the process to implement a reports selection by retrieving the specific Document Header, determining which type of document is related to it in the Report Selection page, and call the report which needs to be printed by passing the specific document header. This specifies the reports that you can print when you work with the various documents for sales and purchases, such as orders, quotes, invoices, and credit memos.

    Know the Pattern

    In Dynamics NAV, you canpreselect which report will be printed when you print from various types of purchase and sales headers. For example, on an order, the Order Confirmation report is automatically printed.

    The Report Selection table contains the specification of which report will be printed in different situations. The Report Selection table also contains the report ID and report name for the report that will be printed when the user works with a given document type. 

    The user can, of course, choose to have Dynamics NAV print a different report than the preselected one. You can also add reports to the Report Selection table to have the program print more than one report per document type.

    This pattern should be used when the user needs to print a new type of document which can have different report layouts, or when the user needs to print several different reports in sequence. This can also be used during a new post and print routine, a test report for journal posting or for re-printing a posted document. Using this pattern will minimize code by allowing a flexible means of specifying different reports to print, instead of hard-coding a report id when printing a document.

    Use the Pattern

    The Report Selection Pattern involves the Report Selection table as the central configuration element also with the Report Selection page.  The table is used in 4 generic functional workflows:

    1) Test Print un-posted

    If the Report Selection is related to a Test Report relating to a document:

    • The document’s page object including printing actions
    • Test Report-Print Codeunit 228

    2) Print un-posted. If the Report Selection is related to an existing document (un-posted):

    • The document’s page object (document / list) including the printing actions
    • The Document-Print Codeunit 229 is used atomically to use the document type in the generic Sales Header table before the report selection is found.

    3) Print while posting. If the document is printed at the point of posting then:

    • The document’s Post + Print Codeunit (82 or 92), with the related GetReport andPrintReport functions.

    4) Print after posting. If the Report Selection is related to an existing document (posted):

    • The specific document related posted header table is used along with a typical function: PrintRecords within the respective table.

    Example

    Sales Document (Invoice)

    Pre-conditions

    • The document header/lines table is present and there is a report which has a parent DataItem linked to this document.
    • A document and list page is present and related to the document.
    • A post-and-print codeunit exists for the document.

    Continue reading on the community.dynamics.com NAV Patterns wiki site...

  • Microsoft Dynamics NAV Team Blog

    What to do when you cannot access a download?

    • 14 Comments

    This month's Cumulative Updates were made available for download this week. Some of you have experienced problems downloading the files, which causes understandable confusion and frustration. The problems can be caused by a number of different issues, including but not limited to server-side issues. The team that runs the download server is in process of verifying that the problems reported by some of you are not caused by issues on their side. So far, the number of successful downloads is higher than most months, but the number of download requests is also higher than normal, which may cause extra stress on the servers.

    If you experience download issues, support professionals in Customer Support Services are ready to help you. Use the familiar support channels in PartnerSource. For example, call your local Microsoft office: https://mbs.microsoft.com/partnersource/northamerica/support/support-news/Support_Telephone, or submit a new technical support  request: https://mbs2.microsoft.com/Support/newstart.aspx. Both pages require PartnerSource access. 

    Alternatively, see https://support.microsoft.com/en-us/contactus. This page is country-/region specific, so change the configuration at the bottom of the page.

    This blog post was updated on 13. July 2015. 

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 21 for Microsoft Dynamics NAV 2013 R2 has been released

    • 6 Comments

    Cumulative Update 21 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013 R2.

    The cumulative update is intended mainly for solutions that are experiencing the problems described in the Knowledge Base article linked to below. However, you are advised to always keep your solution updated with the latest cumulative update. If you are in doubt about whether this cumulative update addresses your specific problem, or if you want to confirm whether any special compatibility, installation, or download issues are associated with this cumulative update, support professionals in Customer Support Services are ready to help you. For more information, see http://support.microsoft.com/contactus/.

    The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

    •   AU - Australia
    •   AT - Austria
    •   BE - Belgium
    •   CH – Switzerland
    •   CZ – Czech Republic
    •   DE - Germany
    •   DK - Denmark
    •   ES - Spain
    •   FI  - Finland
    •   FR - France
    •   IS - Iceland
    •   IT - Italy
    •   NA - North America
    •   NL - Netherlands
    •   NO - Norway
    •   NZ - New Zealand
    •   RU – Russia
    •   SE - Sweden
    •   UK - United Kingdom

    Where to find Cumulative Update 21

    You can download the cumulative update from KB 3075724 – Cumulative Update 21 for Microsoft Dynamics NAV 2013 R2 (Build 41768). 

    Warning

    Before you install a cumulative update in a production environment, take the following precautions:

    1. Test the cumulative update in a non-production environment.
    2. Make a backup of the system or computer where the cumulative update is to be installed.

    Additional Information

    For more information about cumulative updates for this version, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2.

    For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2013 R2

    For a list of all hotfixes included in cumulative updates for this version, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 28 for Microsoft Dynamics NAV 2013 has been released

    • 3 Comments

    Cumulative Update 28 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013.

    The cumulative update is intended mainly for solutions that are experiencing the problems described in the Knowledge Base article linked to below. However, you are advised to always keep your solution updated with the latest cumulative update. If you are in doubt about whether this cumulative update addresses your specific problem, or if you want to confirm whether any special compatibility, installation, or download issues are associated with this cumulative update, support professionals in Customer Support Services are ready to help you. For more information, see http://support.microsoft.com/contactus/.

    The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions: 

    • AU - Australia
    • AT - Austria
    • BE - Belgium
    • CH - Switzerland
    • DE - Germany
    • DK - Denmark
    • ES - Spain
    • FI - Finland
    • FR - France
    • IS - Iceland
    • IT - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway
    • NZ - New Zealand
    • SE - Sweden
    • UK - United Kingdom

    Where to find Cumulative Update 28

    You can download the cumulative update from KB 3075723 - Cumulative Update 28 for Microsoft Dynamics NAV 2013 (Build 41767).

    Warning

    Before you install a cumulative update in a production environment, take the following precautions:

    1. Test the cumulative update in a non-production environment.
    2. Make a backup of the system or computer where the cumulative update is to be installed.

    Additional Information

    For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2013

    For a list of all hotfixes included in cumulative updates for this version, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource:

  • Microsoft Dynamics NAV Team Blog

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

    • 0 Comments

    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 is by defining the relevant field as the primary key. However, this method is not always practical either due to the size of the field or due to business requirements that dictate how duplicates are detected but not necessarily how they are eliminated. An example of this method is to detect contacts with the same name and take action to merge them if they are.

    Before Dynamics NAV 2013, the only possibility was to iterate through the table in a loop and then create a sub-loop where another instance of the same table is filtered to check for duplicates. For example, to check for duplicate names in the Customer table, the code would look like this:

    PROCEDURE HasDuplicateCustomers@26() : Boolean;

        VAR

          Customer@1000 : Record 18;

          Customer2@1001 : Record 18;

        BEGIN

          IF Customer.FINDSET THEN

            REPEAT

              Customer2.SETRANGE(Name,Customer.Name);

              IF Customer2.COUNT > 1 THEN

                EXIT(TRUE);

            UNTIL Customer.NEXT = 0;

          EXIT(FALSE);

        END;


    This code would involve setting filters on the Customer table as many times as there are records in the table. This is an expensive operation.

     Starting with Dynamics NAV 2013, we can use queries to create a more efficient implementation of the same logic. 

    Usage

    The solution involves that you create a query to return duplicates, and then invoke it from a method that would test the value of the query to identify if duplicates were found.

    Step 1 – Creating the Query

    • The query must be created with the table we want to search in as the dataitem.
    • The field we want to search for must be created as a grouped field.
    • Create a totaling field on the count, and add a filter for Count > 1. This ensures that only records with more than one instance of the field that we selected in the previous step are included in the query result.

    Continuing with our Customer Name example, here is how the query would look:

    ELEMENTS

      {

        { 1   ;    ;DataItem;                    ;

                   DataItemTable=Table18 }

        { 2   ;1   ;Column  ;                    ;

                   DataSource=Name }

        { 3   ;1   ;Column  ;                    ;

                   ColumnFilter=Count_=FILTER(>1);

                   MethodType=Totals;

                   Method=Count }

      }

    Step 2 – Invoking the Query to Check for Duplicates

    Now that the query is created, all we need to do is to invoke the query and check if any records are returned, which would mean that there are duplicates.

    Here is an alternate implementation of the HasDuplicateCustomers method using the query that we created:

    PROCEDURE HasDuplicateCustomersWithQuery@27() : Boolean;

        VAR

          CustomerDuplicate@1000 : Query 70000;

        BEGIN

          CustomerDuplicate.OPEN;

          EXIT(CustomerDuplicate.READ);

        END;

     

    Read more on NAV Design Patterns wiki...

    by Abshishek Ghosh and Bogdan Sturzoiu at Microsoft Development Center Copenhagen

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 9 for Microsoft Dynamics NAV 2015 has been released

    • 22 Comments

    Cumulative Update 9 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2015.

    The cumulative update is intended mainly for solutions that are experiencing the problems described in the Knowledge Base article linked to below. However, you are advised to always keep your solution updated with the latest cumulative update. If you are in doubt about whether this cumulative update addresses your specific problem, or if you want to confirm whether any special compatibility, installation, or download issues are associated with this cumulative update, support professionals in Customer Support Services are ready to help you. For more information, see http://support.microsoft.com/contactus/

     The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

    •   AU - Australia
    •   AT - Austria
    •   BE - Belgium
    •   CH – Switzerland
    •   CZ – Czech Republic
    •   DE - Germany
    •   DK - Denmark
    •   ES - Spain
    •   FI  - Finland
    •   FR - France
    •   IS - Iceland
    •   IT - Italy
    •   NA - North America
    •   NL - Netherlands
    •   NO - Norway
    •   NZ - New Zealand
    •   RU – Russia
    •   SE - Sweden
    •   UK - United Kingdom

    Note: You must convert the database if you are upgrading to this cumulative update from a cumulative update earlier than Cumulative Update 9 (build 41779). For more information, see Converting a Database in Help for Microsoft Dynamics NAV. 

    Note: To enable customized translation of profiles, a number of actions are now available on the Profile List page. You can export and import resource files to enable translation for one or more profiles. The steps to install and uninstall language modules have also been modified. For more information, see How to: Install Language Modules, How to: Uninstall Language Modules, and How to: Export, Edit, and Import Translated Profile Strings in Help for Microsoft Dynamics NAV.  

    Where to find Cumulative Update 9

    You can download the cumulative update from KB 3075726 – Cumulative Update 9 for Microsoft Dynamics NAV 2015 (Build 41779). 

    Warning

    Before you install a cumulative update in a production environment, take the following precautions:

    1. Test the cumulative update in a non-production environment.
    2. Make a backup of the system or computer where the cumulative update is to be installed.

    Additional Information

    For information about how to install the cumulative update, see How to Install a Microsoft Dynamics NAV 2015 Cumulative Update

    For information about how to work around a recent process change, see How to Get Back the 'Hotfix Directories' from NAV 2015 Cumulative Update 1.

    For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2015.

  • Microsoft Dynamics NAV Team Blog

    Coffee Break - Monitoring and Troubleshooting Services Part 2

    • 2 Comments

    In this post, we thought we might look into how to use Windows PowerShell to work with XML data. As a user scenario, we are continuing here on our previous post, to look further into server troubleshooting possibilities.

    You might experience an error, warning, behavior that you want to analyze, but have no clear repro scenario for. Troubleshooting these scenarios normally starts with messages logged in the Application Log, and in the previous post we talked about how to check the application log using PowerShell.

    However, you’ll often find that the application log contains insufficient or no details about the problem you’re analyzing.  In these cases, you can trace overall service activity to find the root cause of the behavior you’re looking into. Or the issue might affect one client only, in which case you will want to trace that client (be it Windows client or Web client), to find the cause of the problem. The best option here is to use Windows Communication Framework (WCF) tracing.

    You can enable WCF message logging in the config file for the Dynamics NAV Server instance sothe messages processed by the service are logged. Message logging can be used to diagnose your applications and analyze the root cause of problems. Message logging is not turned on by default; turn on message logging by setting attributes on the <messagelogging> element in your configuration file and then add a trace listener to log the events to a file.

    Similarly, you can enable WCF tracing (in the service config file) to help debug your WCF service by logging all operations on your service.

    You can find more details on different tracing options here, and more details related to tracing on Dynamics NAV here. Here you will find a list of settings we will be adding to server config file to enable tracing.

    Coffee Break 15 - Using Windows PowerShell to enable WCF message logging and tracing on Dynamics NAV Server

    We’ll start by modifying the server config file to add these settings. You can modify your service/client config file by using the WCF Service Configuration Editor. However, as these posts are all about automation, we will naturally look into how to do this using PowerShell.

    There are probably more than one ways to do this, but for this example we have chosen XMLDOM. The service config file is an xml file, so we’ll be using XMLDOM to enable tracing in the config file. To upload an XML-formatted text file as to Powershell XML, all you need to do is strong type it as XML.

    Example:

    $xml = [xml](Get-Content D:\Microsoft.Dynamics.Nav.Server.exe.config)

    Once tracing is enabled, trace and message logs will be stored at the location that you specify:

    $LogFolder = 'c:\Logs'

    if (!(Test-Path -Path $LogFolder)) {new-Item -path $LogFolder -ItemType directory} 

     

    #provide server config file name

    $Filename = 'Microsoft.Dynamics.Nav.Server.exe.config'

     

    #provide full path and name of the config file 

    $ConfigPath = (Get-ItemProperty  'HKLM:\SOFTWARE\Microsoft\Microsoft Dynamics NAV\80\Service')

     

    #Upload config as xml document

    [xml]$blobxml = Get-Content -Path  (join-path ($ConfigPath).Path  "\$Filename" ).ToString()

     

    To see all methods and properties of the XML object, run

    Get-Member -InputObject $blobxml

     

    To check the childnodes of the document, use

    $blobxml.ChildNodes

     

    To create a node, use

    $elem = $blobxml.CreateNode('element',<node name>,'') 

     

    To append the node:

    $Node.AppendChild($elem)

     

    For full reference to XMLDOM class, methods and properties, see the MSDN Library.

    The complete example of enabling WCF tracing using PowerShell is attached to this post (ServiceTracing_PS.ps1).

    Note that the example adds the following tracing configuration:

    MessageLogging,  switchValue="Warning, ActivityTracing"

    Tracing, switchValue="Verbose,ActivityTracing"

     

    wmiProviderEnabled= "true"

     

    logEntireMessage="true"

    logMalformedMessages="true"

    logMessagesAtServiceLevel="true"

    logMessagesAtTransportLevel="true"

    maxMessagesToLog="100000"

    maxSizeOfMessageToLog="10000000"

     

    These should be adjusted as needed (see tracing options).

    Once the config file is modified, you must restart the service for tracing to start. Logs will be generated at the specified location (in our example c:\Logs).

     

    After you have captured the event, you should turn off the tracing. One can either replace the modified .config file with the original one (that will remove tracing configuration), or modify the relevant settings (using PowerShell, of course) to turn off the tracing.

    Settings to modify to turn off tracing (following the example above) are :

     

    MessageLogging,  switchValue=" "

    Tracing, switchValue=" "

     

    wmiProviderEnabled= "false"

     

    logEntireMessage="false"

    logMalformedMessages="false"

    logMessagesAtServiceLevel="false"

    logMessagesAtTransportLevel="false"

    maxMessagesToLog="0"

    maxSizeOfMessageToLog="0"

     

    Tracing will stop once the service is restarted using the above configuration (or original config file).

    An example of a script to turn the tracing off is also attached to the post (Stop_Server_Tracing.ps1).

     

    Run the above scripts remotely on your customer’s server to trace the customer’s service (on premises or in the cloud) to enable /disable server tracing and messaging.

    Happy troubleshooting!

     

    Jasminka Thunes, Escalation Engineer Dynamics NAV EMEA

    Lars Lohndorf-Larsen, Escalation Engineer Dynamics NAV EMEA

    Bas Graaf, Senior Software Engineer Dynamics NAV

  • Microsoft Dynamics NAV Team Blog

    Coffee Break - Monitoring and troubleshooting NAV Services

    • 3 Comments

    Windows PowerShell is very well suited for monitoring services because tasks can be repeated and they can run remotely. In this post we will look at how to check the Application Log via Windows PowerShell, locally as well as remotely, to look for errors or for certain words in the log. The customer story this time is that users report a problem and you need to find the cause. The first place to look (at least in some cases): the Application Log.

    In future posts we will look at tracing the service tier/client activity using powershell and WCF, and other ways to monitor and troubleshoot. As always, comments are welcome if there are any particular things you would like to see.

    Coffee Break 14 - Using Windows PowerShell to check and search the Application Log.

    There are two main ways to get the Application Log with PowerShell:

    • Get-EventLog
    • Get-WinEvent

    For more details on this (and which one to use), check this post on the Goatee PFE blog. In short: Get-EventLog is the simple way. Get-WinEvent is the more flexible way. Here, we will use Get-WinEvent.

    Get the Application Log

    Get-WinEvent -LogName Application -MaxEvents 100

    or read it from a saved log:

    Get-WinEvent -Path "c:\Temp\MySavedLog.evtx" -MaxEvents100

    or from a remote machine:

    Get-WinEvent -MaxEvents 100 -ComputerName MySvr2012

    or from a list of remote machines:

    $Servers="localhost","MySvr2012"

    foreach($Server in $Servers) {$Server ;Get-WinEvent -logname Application -MaxEvents 100 -ComputerName $Server}


    Look for providers

    One of the advantages of Get-WinEvent, is that it filters on source, and only transfers the filtered events back when retrieving events from a remote machine. In the Application Log, Provider = Source. When we are just looking for Dynamics NAV events, then filter on Dynamics NAV. First find the provider / source:

    Get-WinEvent -ListProvider *nav* | Format-Table

    Then filter on Dynamics NAV, whether the service you want to check is NAS, Web Service, Dynamics NAV Server, or any other service. For this example let's use "MicrosoftDynamicsNavServer$DynamicsNAV80"

    Get-WinEvent -ProviderName "MicrosoftDynamicsNavServer`$DynamicsNAV80"

    Notice the escape character  ` before the $-sign to tell PowerShell that we want the $-sign, and are not referring to a variable.

     Use FitlerHashTable for filters

    Once we start adding multiple filters to Get-WinEvent, we need to provide them as Key-Value pairs. The supported values for filtering is listed here: Supported Filter Values:

    • LogName <String>
    • ProviderName <String>
    • Path <String>
    • Keywords <Long>
    • ID <Int32>
    • Level <Int32>
    • StartTime <DateTime>
    • EndTime <DataTime>
    • UserID <SID>
    • Data <String>
    • * <String>

    The syntax is:
    @{Key=Value;Key=Value;etc}

    Example: Look for Application Log entries from Dynamics NAV:

    Get-WinEvent -FilterHashtable @{LogName = "Application"; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80"}

     

    Useful filters:

    Find error logs: Filter on Level = 2 (Level 4 is Information)

    Date Filters: $MyDate = Get-Date / (Get-Date).AddDays(-2)

    Example: Find Error logs from Dynamics NAV for the last week:

    $EndDate=Get-Date

    $BeginDate= (Get-Date).AddDays(-7

    Get-WinEvent -FilterHashtable @{LogName = "Application"; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80" ; StartTime = $BeginDate; EndTime = $EndDate ; Level =2} 

    And Remotely

    Invoke-Command -ComputerName MySvr2012 -ScriptBlock {Get-WinEvent -FilterHashtable @{LogName = "Application" ; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80" ; level = 2}}

    More details about remoting PowerShell with Dynamics NAV here.

    Find specific events

    Find a specific event in the Application Log:

    $pattern = "NAS Startup Parameter"#or

    $pattern = "The service has registered service principal names "#or

    $pattern = "Deadlock"#or

    $pattern = "System.InvalidCastException"#or

    $pattern = "Server instance: DynamicsNAV80"#or

    $pattern = "listening to requests at net.tcp"#... etc

    Get-WinEvent -FilterHashtable @{LogName = "Application" ; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80"} | where {$_.Message.Contains($pattern)} | foreach {"$($_.Message) `n-------`n"}

    Printing details

    You may have noticed that the examples above only print the first few characters of each event. To get the full event (but also mess up your screen), simply format as list:

    Get-WinEvent -FilterHashtable @{LogName = "Application" ; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80"} | Format-List

    or keep it in table format but wrap each line:

    Get-WinEvent -FilterHashtable @{LogName = "Application" ; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80"} | Format-Table -AutoSize -Wrap

    or control the output via a variable:

    $Events=  Get-WinEvent -FilterHashtable @{LogName = "Application" ; ProviderName = "MicrosoftDynamicsNavServer`$DynamicsNAV80"}

    $Events[1].Message

     

     

     

    Jasminka Thunes, Escalation Engineer Dynamics NAV EMEA

    Lars Lohndorf-Larsen, Escalation Engineer Dynamics NAV EMEA

    Bas Graaf, Senior Software Engineer Dynamics NAV

     

     

  • Microsoft Dynamics NAV Team Blog

    New Application Design Patterns: Totals and Discounts on Subpages

    • 5 Comments

    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 and apply discounts directly on the document.

    Description

    Before Microsoft Dynamics NAV 2015, totals and discount information was scattered between the document and the Statistics page, which made it less discover-able and less usable for new users. It was difficult to see the discount amounts, relate the amounts to the currency of the invoice, and it was not-intuitive that you had to update the Statistics page to see updates on the document. In addition, the result of the update was not visible on the main document, which added to the confusion.

    Totals and discount information logically belongs on the document, as is the case in many competitor products.

    The Statistics page contains too much information for most common scenarios, and only a part of the information is visible on the related document. See the following example for sales order statistics.

    With the pattern implemented, selected statistics fields are placed on the sales order, as in the following example.

    This new layout gives precise and complete information about totals and discounts, with discounts on the left side and totals on the right side. The currency is clearly shown, and the layout resembles a printed document. The values are always updated (with some exceptions that are explained in the next following sections), and the user can apply a discount directly on the document.

    Read more on the NAV Design Patterns wiki...

    By Nikola Kukrika at Microsoft Development Center Copenhagen

  • Microsoft Dynamics NAV Team Blog

    Best Practices Tips and Tricks for Upgrading to Dynamics NAV 2013 R2 or Dynamics NAV 2015 Part 2

    • 8 Comments

    In an earlier blog post, we started to mention some tips and tricks to help you plan your upgrade to a newer version of Microsoft Dynamics NAV . In this post, we would like to share with you some of the known issues we stumbled over in the past couple of months or years, and what can you do in case you get into any of these known situations.

    Today, it's mainly not about the solutions we give; sometimes it works at first try, sometimes you need to take another approach. We want to highlight how you should think about the different situations you get into, and what you should  check for. So, based on our experience, we list here some of the main points that you need to understand carefully while facing some issues during your upgrade.

    Synchronization Issues

    As you know, with Microsoft Dynamics NAV 2013 R2 , we introduced a number of changes to the product comapared to Dynamics NAV 2013 with the new support for multitenant deployments. You can read something about that here:

    Based on this new architecture, compiling and synchronizing objects to SQL Server becomes more sophisticated than before. A well-known issue is that when you upgrade to Dynamics NAV 2013 R2 / NAV 2015 and open the Windows client for the first time, you would not be able to start the client and you would get the following error:
    ‘Invalid Column name’ or ‘column xxx already exist’ or ‘Column xxx does not exist’.

    To explain this in a better way, we published an explanation of the new design and how to work on it to avoid having this error:

    http://blogs.msdn.com/b/nav/archive/2014/03/27/table-synchronization-paradigm-in-microsoft-dynamics-nav-2013-r2.aspx

    Read that blog post before you start on step 11 in the upgrade from Dynamics NAV 2009 SP1/R2 to Dynamics NAV 2013 R2 , or step 7 in the upgrade from Dynamics NAV 2009 SP1/R2 to Dynamics NAV 2015. At that point, you are getting ready to import an .FOB file with all your objects. Based on the size of the database and the amount of customizations, you might want to export the objects to more to than one .FOB file so that you import the objects in a couple of separate rounds to simplify the first synchronization process. Here are the steps to follow:

    1. Start with a clean database in case you already had sync errors, restored the backup before you tried to start the Windows client.
    2. Always work on the latest build possible because we regularly solve lots of issues related to sync on later builds. Proceeding with an older build of Dynamics NAV is not recommended. See following links to identify the latest build for your version of Dynamics NAV:
    3. When you know the KB number (i.e. cumulative update ID number from the above sites) for the build you want, you can use the following link to request the build from Microsoft (just replace the KB number kbnum in the URL):

      https://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=3035983&kbln=en-us&sd=mbs

    4. Go to the configuration of the service and change ‘SQLCommandTimeout’ to a big value such as 10 hours. The default is 30 minutes, which is too small a window.

      Also do not forget to check if your remote query timeout (s) parameter in your SQL Server (In case it was changed before to any very low value).

    5. Restart the service.
    6. Import the .FOB with all your objects.

      If the .FOB file contains too many objects, you can create one .FOB file with table objects and another .FOB file with the rest of the objects. You would then import first the tables .FOB and synchronize the database schema, and then you import the second .FOB and sync. Alternatively, simply do not import all objects at once.

    7. Make sure all objects are compiled on whatever build number you are using.
    8. Do no start the Windows client (RTC) as this could cause a synchronization problem. Also, in Dynamics NAV 2015, do not start the sync inside the development client (although it is available). We recommend running the first sync ever using the PowerShell command Sync-NAVTenant:
      1. Go to start menu, search for Start ‘Power Shell ISE ‘as this is preferable to the Dynamics NAV Administration Shell for this purpose. Always run the ISE as administrator.
      2. Run the below command to avoid restrictions:

        Set-ExecutionPolicy Unrestricted

        A message will show up, confirm by pressing Yes.

      3. Run the following command to import the Dynamics NAV administration tools (amend path if necessary):

        Import-Module "C:\Program Files\Microsoft Dynamics NAV\80\Service\NavAdminTool.ps1"

      4. Run the Sync command ‘Sync-NAVTenant’ for the relevant instance. For Dynamics NAV 2015, see following resources for more parameter you can use for the sync: https://msdn.microsoft.com/en-us/library/dn466418(v=nav.80).aspx

        .. or run following command in PowerShell: get-help Sync-NAVTenant -online

      5. Let it run as long as it takes and do not try to interrupt it even if it takes hours long, till either PowerShell is ready for another command again, which means the sync did run properly, which means you can start your Windows client without issues, then carry on following the upgrade blog, or the upgrade document for Dynamics NAV 2015.

        In case the upgrade is to Dynamics NAV 2015, it is much easier, because it includes a status bar to show you the progress of the sync.

      6. If any errors occur, it will be written in PowerShell, check please the event viewer of the service tier again, for Dynamics NAV 2015 you can always run the command:

        Get-NAVDataUpgrade InstanceName -ErrorOnly

    Having all the above information in mind should make you fit in case of having sync. Issues while upgrading to avoid any unpleasant surprises.

    Time estimated for the sync process, is always related to the amount of objects synchronized at once vs the amount of resources you do have on your SQL Server, note that you can be having lots of resources on the SQL Server machine, but you might have not configured it properly to get full use of these resources.

    Collation Issues

    Before we start keep in mind that starting from Dynamics NAV 2013, the supported collations are only Windows collations, and this is for better support to the Unicode compatibility, so if you had a database on older version using SQL Collation, it will be changed automatically while upgrading. This can have an Impact on the Upgrade and can cause some known errors:

    • Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object.
    • It might be not really duplicate, but because the windows collation cannot interpret all characters that the SQL Collation could interpret, it might seem to be the same.
    • Here you have to make sure that all your primary keys are not depending on the used SQL Collation in older version.

    Another type of error, while trying to start step 2 to convert data is:

    • SQL error during migration, usually in the following form:

      The following SQL error is not expected

      The data type nvarchar cannot be used as an operand to the UNION, INTERSECT or EXCEPT operators because it is not comparable.

      Statement(s) could not be prepared.

      This type of errors can occur if depends on whether you are using case sensitive or case insensitive collation, and if you have objects having different collations than other objects.

      Usually it occurs in similar statements like the one below:

      declare @p1 intset @p1=-1exec sp_prepexec @p1 output,N'@0 nvarchar(1),@1 nvarchar(1),@2 nvarchar(1),@3 nvarchar(1),@4 nvarchar(1),@5 nvarchar(1),@6 nvarchar(1),@7 nvarchar(1),@8 nvarchar(1),@9 nvarchar(30),@10 int',N'SELECT TOP 1 * FROM (    SELECT     CAST (0 AS timestamp) AS [Timestamp],        [Company Name],        [ID] AS [Table No_],        [Name] AS [Table Name],        CAST (CASE WHEN [Row Count] > 2147483647 THEN -1 ELSE [Row Count] END AS int) AS [No_ of Records],        CASE [Row Count] WHEN 0 THEN 0.0 ELSE [Size] * 1024.0 / [Row Count] END AS [Record Size],        CAST (CASE WHEN [Size] > 2147483647 THEN -1 ELSE [Size] END AS int) AS [Size (KB)] FROM (  SELECT            [Company Name],            [ID],            [Name],            SUM(row_count) AS [Row Count],            SUM(reserved_page_count) * 8 AS [Size]  FROM (   SELECT    C.[Name] AS [Company Name],    O.[Object ID] AS [ID],    O.[Name],    C.[Name] + ''$'' + O.[Name] AS [Company Qualified Name]   FROM [Sprügel].[dbo].[Object Metadata Snapshot] AS O   CROSS JOIN [Sprügel].[dbo].[Company] AS C   WHERE O.[Data Per Company] = 1 AND O.[Object Type] = 1   UNION   SELECT    '''' AS [Company Name],    O.[Object ID] AS [ID],    O.[Name],    O.[Name] AS [Company Qualified Name]   FROM [Sprügel].[dbo].[Object Metadata Snapshot] AS O   WHERE O.[Data Per Company] = 0 AND O.[Object Type] = 1        ) AS [O]        INNER LOOP JOIN [Sprügel].[sys].[dm_db_partition_stats]                ON object_id = OBJECT_ID(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE([Company Qualified Name], @1, @0), @2, @0), @3, @0), @4, @0), @5, @0), @6, @0), @7, @0), @8, @0)) AND (index_id < 2 OR index_id = 255)  GROUP BY [Company Name], [ID], [Name]    ) AS [Core Query]) AS [Projected Query] WHERE ("Company Name"=@9 AND "Table No_"=@10) ORDER BY "Company Name" ASC,"Table No_" ASC',@0=N'_',@1=N'.',@2=N'"',@3=N'\',@4=N'/',@5=N'''',@6=N'%',@7=N']',@8=N'[',@9=N'',@10=0select @p1

      This Union here is causing the issue based on the used collation because it is not matching what SQL server expects.

    • Usually changing the collation solves the situation, as mentioned here: http://www.mibuso.com/forum/viewtopic.php?f=32&t=59489&start=0

      But you have to be careful while doing it manually.

    It would be also good to understand what does the collation change exactly do, especially if you are changing the collation of a huge database:

    • The collation change process is simply running through every character based NAV field in the DB and issuing the following statement:

      ALTER TABLE "<table name>" ALTER COLUMN "<column name>" VARCHAR(xx) NOT NULL

    • And this involves every character field in every table, so especially for huge database, you need to plan the time for this properly, in the section related to Performance we will be back to this in more details.
    • In case of flow fields, in the conversion process to Unicode, The conversion is going through all these records and set the BLOB fields to NULL value.

      (Loop cursor type of data upgrade), and after it finishes, the data would be returned, as you would be saved temporarily.

    • So the more FlowFields you have, the more performance issues you might experience.

    In huge databases, it is always recommended to do the change collation as a separate step in Dynamics NAV 2009 Classic Client before you even start the upgrade.

    • This will give you more control on the collation change yourself.
    • You can see if it works well, or if you might need to change the collation of some objects manually on SQL Server.
    • You can see if the database has performance issues or not, and if it is related to the collation change, or rather to the Unicode conversion.

    If you change the collation for a Dynamics NAV database using the NAV Development environment on versions 2013 R2 or later you might notice some subtle differences compared to earlier versions. See the following blog for more details: http://blogs.msdn.com/b/nav/archive/2014/12/04/how-to-change-the-collation-on-a-dynamics-nav-2013-r2-database.aspx

    Data Conversion Issues

    Data conversion is a very sophisticated process, and takes into consideration lots of are factors like the design of the tables and the relations of these tables so as the integrity of the indexes and the collation before working on converting the data itself.

    If you have customizations that do not take care of all these dependencies you might get an issue while converting the data.

    Let us look at an example:

    • It can happen that when the conversion starts conversion of object metadata the following error is received: The following ODBC error occurred: Error: [Microsoft][SQL Server Native Client 10.0] Unspecified error occurred on SQL Server. Connection may have been terminated by the server. State ID: HY000.
    • The main reason here might be some tables / any other objects in the database that do not compile because of some functions that are missing in the tables, or that do not maintain the design or the structure of other objects. For example when changes have been made to the tables directly in SQL.
    • Here again we mention that the database on the original version before the upgrade has to be checked to avoid these issues.
    • For a possible workaround here make a NAV backup of the NAV 2009 database and restore the backup into a new database and you will be able to convert the database.

    Another example is a typically known error:

    • The supplied Field name ‘’ does not exist in the ‘’ table.
    • Some fields like field number 1300 in table 112 are automatically added while running step number 11 in the upgrade ‘see the blog mentioned above’.
    • In some cases if an Issue causes this field, or any other fields not to be created, the data conversion will not run and will look for these fields and return errors.
    • Carry on the step again and make sure that the fields are added and synchronized to SQL properly as explained in the previous points.

    Error Code 85132273 in Dynamics NAV 2013 R2

    While upgrading and in some steps while compiling either system tables or customized tables, you can get an error such as this one:

    • ERROR CODE : 85132273
      • This error code is a PRIMARY KEY violation. This occurs due to different reasons, it can be that on the older versions there were some special characters in the primary keys. In this case, looking for the key causing the issue and correcting it might be the best way.
      • Starting from Update Rollup 9 this error code has been handled to show friendlier message to point to where the error is. It can be that the names of some fields in table are depending on some other ones that are not synchronized yet. To work against this, we wrote another blog post with more info that can help against this:
      • http://blogs.msdn.com/b/nav/archive/2014/07/04/synchronize-metadata-please.aspx
      • Sometimes the same error can be because of not having the system tables compiled before imported the new fob. 

    However, sometimes you get another error, even though you have synchronized all objects :

    Table Index Issues

    As we mentioned before the upgrade procedure takes many factors into consideration. One of these factors is the indexes for the tables.

    • It is often the case that while working on the upgrade you cannot go further because of the following:
        • Wrong or missing indexes.
        • Indexes that show up as null indexes.
        • Indexes that are amended manually.
      • The best way to figure this out the database check tool.
      • In KB 2963997 you find the data base check tool where you can check the database for any internal metadata inconsistencies in the Dynamics NAV database.  We recommend running the command line tool and routing the output to a text file. You can then search the text file for any occurrences of “Error:” as this is the prefix used for any error messages. 
    • In some other cases the Null indexes are coming from older bugs in older versions.
      An example of this is as following:
      • After upgrade from Dynamics NAV 2013 R2 Rollup 2 to Rollup 6 you get this error - which was coming with Rollup 5 and should be solved with Rollup 6!
      • "The server [server name] was unable to process the request. Close the application and start it again" error message when you start the Windows client after converting the database to build 36281.
      • System.Data.SqlTypes.SqlNullValueException

        Message: the value of the SQL Server index cannot be null.

      • A good workaround for this would be by restoring a .fbk backup on another newly created database.
    • In some other example the statistics of some tables can have no index.
    • The tool mentioned above will help you finding it out.
    • Deleting this statistics would resolved this, because you are not allowed to have a statistic with a missing index.

    Upgrade Performance

    The performance of the upgrade might vary based on the size of the database and the size of the customizations,  During the upgrade, there are 3 procedures that might be the bottleneck especially while upgrading huge databases:

    • Changing the collation to windows collation while opening the database the first time with the NAV 2013 Windows client.
    • The Unicode conversion step.
    • While Importing FOB the first time in NAV 2013 R2 / NAV 2015.
    • While Synchronize the Imported FOB.
    • While transferring the Data in NAV 2013 R2 / NAV 2015. 

    Of course depending on the situation of the database, make sure before you start upgrading that you had maintenance plans running on the older database, and that all indexes and statistics are updated gradually  so that the database does not have a general performance issue

    • Check if the database is not having any issue, simply by running dbcc checkdb against the database in SQL server.
    • Fob Importing might take a lot of times for huge FOBs, here we have issued more than one hot fix to help against this, be sure you are on latest build (see point #2 on page 14 of this document for details about how to access the latest build for your version of Dynamics NAV
    • In case the number of customizations is big and the database is huge, do not import one fob with all Objects, divide the FOB into more than one package as mentioned previously in this document.
    • Take care you are running the upgrade on a adequately resourced SQL Machine that is properly configured to get the use of all possible resources (there is more than one sql configuration document for Dynamics NAV on Partner source).
    • Be aware that if the SQL Machine is too weak, and the process of the first sync would take more than 6 hours, it is likely that SQL server will reject the process with a timeout.
    • In case any sync process did not run till the end, be sure that a rollback will be running, do not re-try to run the sync or worse to restart the service before it finishes.
    • You can monitor such a rollback with the following command:
      • select percent_complete, * from sys.dm_exec_requests  
    • The time of the import and the sync is highly depending on the number of companies in the database, so if you have any unused companies, or demo companies inside the database, we highly advise to remove it before starting the upgrade.
    • Some partner do run the upgrade only on one company, and then later on create the other companies and use some own customized SQL Query from other upgraded databases containing the data ‘a database for each company for upgrade sake’, it might sound complicated, but it runs much faster than having it all in one box.
    • Remove any unneeded companies from the database to avoid any unnecessary overhead.
    • Remove any unneeded flow fields, as we said before while changing the collation NAV works on every flow field on its own.
    • Make sure there is plenty of SQL Server log space available as the upgrade process can be very demanding on log space. You can reduce the SQL log size for the NAV database after the upgrade process is complete.
    • For huge databases, we suggest running the change collation as a separate step in 2009.
    • In that case, I would even try to change the collation of the top 5 or top 10 tables manually on SQL Server .‘The tables having most records, especially if we are talking about more than 10 million records per table’.
    • Get rid of all not needed indexes, scan especially the huge tables, and remove any unneeded ‘maintainsqlIndex’.
    • Make sure you are running on a well configured SQL Server with enough resources, if you are not sure, communicate with Microsoft support to ask for their opinion about your configuration.

    System Tables with Non-English Names

    In the oldest versions of Dynamics NAV, you could translate the columns in system tables to a language other than English. Starting with version 3.0, we adviced heavily against this, and versions later than Dynamics NAV 2013 R2 require that all columns in all system tables are in English. As a result, if you try to open a database with non-English system tables in Dynamics NAV 2013 R2  or Dynamics NAV 2015, you will see an error, saying that one or more columns do not exist. 

    if you are upgrading a database where the system tables are translated, do the following:

    • Make sure you use the right version of the .ETX and .STX files.
    • Make sure that all objects where compiled in a development environment with the right .ETX and .STX files.

    You can verify that you are running in the correct environment with English (US) as the base language by opening the ndo$dbproperty table in SQL Server Management Studio and verifying that, in the Identifiers column, the word Object is written exactly as that and not in any other way.

    The example above is only one of the possibilities you might see in case if using other languages than English in naming system columns.

    Company Names in Dynamics NAV 2015

    In more than one situation, you might encounter errors related to the naming conversion of your companies in Dynamics NAV.This is usually not an issue in Dynamics NAV 2015 or any older version; rather it is related to the upgrade routine itself.

    If a company name includes a special character, or it starts with a number, you might get an error: ‘Incorrect Syntax near…’

    • The issue with having this error because of having a digit at the beginning of the company name was resolved in Cumulative Update 3.
    • But still if you are having any other special character ’ in the company name, you might get the same error. In this context, special characters include the following: [ ~ @ # $ % & * ( ) . ! % - + / = ? ]
    • An easy solution for this is to rename the company before starting the upgrade. After the upgrade is successfully finished, you can re-rename the company again.

    We warmly recommend that you maintain a good naming convention, and try to avoid any special characters in company names.

    Upgrade Codeunits and Data Upgrade in Dynamics NAV 2015

    Dynamics NAV 2015 introduces the concept of upgrade codeunits. We worked on the way schema synchronization and data upgrade works in Dynamics NAV 2015, because some of you experienced problems with the way database synchronization worked when we first launched Dynamics NAV 2013 R2.

    Essentially, when you introduce changes to the database schema in Dynamics NAV 2015, Dynamics NAV will be always checking if these changes are destructive or not, and if there is a fear that these change might lead to some data being deleted (such as if you are dropping a table column so that the contents of that column will be deleted). If such as destructive change is detected, you will be prompted to handle the situation using upgrade codeunits.

    This was explained on the community blogs more than once, but we suggest that you watch this video to understand what is really going on: 

    How Do I: Synchronize Database Schema Using Upgrade Codeunits in Microsoft Dynamics NAV 2015

    On the other hand, if you think that these changes are not going to cause issues, you can take a backup of the database, and try to re-run the Sync-Nav Tenant command with the force Option manually again, but we rather advice you to be cautious when it comes to this option.

    It is always better to run Sync-NAVTenant with check mode only to see what objects might be a source of destructive changes.

     

    As mentioned before, we intended in this blog to summarize some of the tips and the tricks we learned while working on upgrade, some of these information might be basic for some partners, and some might be invaluable, at the end, I just wanted to share the information in a way that might make your life easier when you upgrade.

    Abdelrahman Erlebach

    Microsoft Dynamics NAV Support EMEA

  • Microsoft Dynamics NAV Team Blog

    Best Practices Tips and Tricks for Upgrading to Dynamics NAV 2013 R2 or Dynamics NAV 2015

    • 11 Comments

    Earlier, we announced that Dynamics NAV 2009 SP1 and Dynamics NAV 2009 R2 would go out of mainstream support in January 2015, and that means that the Classic Client stack is no longer supported:

    Mainstream Support for Microsoft Dynamics NAV 2009 ends January 13 including 2009 SP1 and 2009 R2

    We know that many of you have been upgrading to the latest version for years so that you would benefit from the various impreovements and new functionlity that new versions include. but with Classic Client no longer supported, it's time to get your customers upgraded to the Dynamics NAV Windows client, and that’s why we issued lots of documents and articles to help you in this process, including the option of automating the upgrade process.

    But over the past couple of years, we in the Support organization have collected a range of tips and tricks that we would like to share with you to help you get your customers upgraded. We will be summarizing those tips and tricks in 2 blogs, this one and another one following soon.

    The purpose of this is to lay the ground for future upgrades, and to guide you in the best practices for upgrading from the older Dynamics NAV platforms to the latest.

    This includes the following points:

    • Preparation - what should I take care of before I start?
    • What should I follow to guarantee a successful upgrade?
    • Known Issues and how to work around some complicated situations during upgrade.

    Preparations

    The first question is always, what should I take care of before I start? Do I have to prepare anything at all? What are the available toolkits to use, where do I find them?

    Available Upgrade variations and toolkits

    In this section we will be mentioning the available variations from toolkits and methods used to upgrade to Dynamics NAV 2013 R2 / Dynamics NAV 2015, so as you can plan which toolkit to use based on the current version of the database that need to be upgraded.

    First, get the right upgrade toolkit for the job:

    Upgrading from:

    Toolkit / Variation:

    Microsoft Dynamics NAV 2013

    Standard Upgrade Toolkit. 

    Microsoft Dynamics NAV 2013 / R2

    Standard Upgrade Toolkit / Automated Data Upgrade

    Microsoft Dynamics NAV 2009 SP1

    Upgrade first to NAV 2013 and then to NAV 2013 R2 / NAV 2015

    Microsoft Dynamics NAV 2009  R2

    Upgrade Toolkit directly  to NAV 2013 R2 / NAV 2015

    Older Version

    Has to get first to Microsoft Dynamics NAV 2009

    Get the upgrade toolkit from the product media of the version you upgrade to. At the end of this blog post, we list a couple of links to videos and steps.

    OK, now I have the right tool kit, what should I take care of before I start?

    So as you guarantee that you will not face big Issues while upgrading or later on while working on Microsoft Dynamics NAV 2013 R2 / Microsoft Dynamics NAV 2015, please consider the following:

        • Are all objects compiled?
            • You must make sure that all your objects are compiled before the transformation because any not compiled objects can be a potential reason for lots of upgrade issues.
          • What to do with third party objects?
            • Third party objects also have to be fully compiled before you start.
            • You have to have the right license that allows you to compile these objects.
            • If the third party objects are old, and no longer going to be used, you have to delete them before you start.
            • In some situations the license does not exist because there is no relation to the party that developed the component, in this case we have to work around this by deleting the objects from the database and cleaning it from the Objects table and the Objects Metadata table manually on the older database before you start.
          • Why should all objects (if possible) be compiled?
        • Are you using any other language / Localization different than W1?
          • Having a different collation?
            • There was a collation change between older and newer versions of NAV.
            • Starting from NAV 2013 we are pushing the use of Windows collations Vs SQL Server Collations, this means if you used SQL Server special collations in older Databases, you should have some extra work preparing the data.
            • It is mainly about ensuring that no Primary key fields depend on the SQL old collation, so in case you have primary Keys with any special characters, you might be obliged to work on these values before upgrading.
            • One example in the German language is the letter ‘ß’ that would be recognized from the 2 letters ‘SS’ only in some special collations in sql.
            • If you do have a violation of primary key related to such an example, be aware that it is a data issue, and it has to be manually treated.
            • Consider that collation changing for huge databases might be a long process that needs to be planned properly, we will be back to the collation point later on in this document, talking about collation issues.
          • Special caption problem?
            • More than once it was reported, that while converting the data in NAV 2013 R2 / NAV 2015, you get errors related to a value that is invalid.
            • Mainly these Values are coming from the captions of come objects in the older database.
            • After converting the data from non-Unicode to Unicode data, and moving some values between CAL to xml, some characters could give a value that is not recognized by NAV2013 R2 / NAV 2015.
            • These values would be saved in Metadata after or while compiling those objects the first time in NAV 2013 R2 / NAV 2015
            • As an example:
              “Hexadecimal value 0x[whatever] is an invalid character”
              To check what is valid and invalid, please check quickly the link below:
              http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/
            • The problem here is: sometimes you cannot know exactly where this value might exactly be.
            • If you do not know where the problem is, you could try removing the captions before starting the Upgrade, carry on with your upgrade without it and try to re-import it again afterwards.
        • Do you have Dimension codes and values especially coming from older versions?
          • The structure of dimensions in Microsoft dynamics NAV has changes couple of times between versions, especially if you come from a very old version.
          • What you need to make sure of before upgrading is that if you do have any dimensions used in details tables that they are also existing in the master table of dimensions.
          • Simply you need to make sure that the relation between the dimension value table and all dimension related transaction tables are well maintained.A famous example for a well-known error while upgrading to NAV 2013 R2 / NAV 2015 is the following:
            'Dimension value ID' must contain a value in 'dimension set items': 'dimension set id = 0, dimension code = COST CARRIERS'. Value cannot be null or empty
            or
            'Dimension Value ID must have a Value in Dimension Set Entry' 
            • This is mainly about the relation between the dimension value table and the transaction tables containing dimension Informations
            • For example the values that are in table 355 and do not exist in table 349 can cause such an error.

              You can check the consistency with a simple query (in case it is now related to a missing value in the G/L Entry table):

              select * from

               CRONUS AG$Ledger Entry Dimension] A

               where A.[Dimension Value Code] not in

               (

               select B.Code

               from

               [CRONUS AG$Dimension Value] B

               )

          • In case of any found inconsistency, check the values, and either to add it to the master table 349 or to delete it from 355.
          • The above query example would not apply to all situations, it is just an example to illustrate how to approach such an Issue.
          • Another reason for this, would be having some special characters in the dimension name, which might not be understood after the collation change that took place while opening the database the first time with the Dynamics NAV 2013 client.
          • There was also a good blog discussing the same behavior: http://www.mibuso.com/forum/viewtopic.php?t=57192
          • Another Example would be also related to dimensions in case you had something to do with Service management Module in older versions
            • Also in Step 2 in NAV 2013 R2 / NAV 2015 you would get a similar error:
          • The Metadata Object of Table 5930 was not found.

          •  There was an Older internal KB article related to upgrading to NAV 2009 with service management module Talking about this before stating the following:
          •  Due to major changes in the design of the Service Management functionality, it is necessary to remove unnecessary service-related data stored in the database to avoid data inconsistency and business logic gaps when upgrading to Microsoft Dynamics NAV 2009.

          • A simple solution to this would be deleting all records related to Table 5930 from table Posted Document Dimension before starting the step 2 at all.
        • Huge Database
          • Upgrading huge Databases should be carefully planned, starting from planning the right resources, up to planning enough time for testing, because it might take you the first time very long till you understand how to optimize he upgrade for a huge database.
          • Every database is a different situation, so please take you time planning for every database based on the following:
            • Do you have owned vertical solutions / customized add-ons.
            • Do you have many Companies in the same database?
            • Do you use FlowFields excessively in your customizations?
            • Is your database more or less than 100 GB, did you plan enough hardware resources on your test server? And please consider doing this starting from the first test to avoid wasting time testing on week machines.
            • Think also about involving Microsoft support from the beginning, to get some advices while planning your upgrade.
          • Huge databases might fall into performance issues while upgrading.
          • We will be back to the subject ‘Performance while upgrading’ again in this document, to talk about it in more details

    What should I follow to guarantee a successful upgrade?

    Upgrading to Dynamics NAV 2013 R2 / NAV 2015 can be a complex and a time consuming if you do not know what guide to follow, for such a long process you need to have always a step by step procedure to guide you till the end of this activity. We do have many materials on this in the community, partner source and on our blogs, but we thought it would be good to mention some of these recommended material so as you can follow while upgrading.

    As we mentioned earlier in this blog post, it depends on which version of Dynamics NAV are you coming from. You can get an overview of the steps required in the MSDN Library here:

     

    Also, you can watch these videos:

    For upgrading from Dynamics NAV 2013 R2, you can use automation. For inspiration, watch this video:

    http://www.youtube.com/watch?v=cuYV4FO97U0

    This Toolkit with the step by step explanation on how to use it, can be found in the following Blog:http://blogs.msdn.com/b/nav/archive/2013/11/22/upgrade-toolkit-for-upgrading-data-from-microsoft-dynamics-nav-2009-r2-and-microsoft-dynamics-nav-2009-sp1-to-microsoft-dynamics-nav-2013-r2.aspx?PageIndex=2

    For upgrading from Dynamics NAV 2009 SP1/R2, at first you had to upgrade to Dynamics NAV 20132, but how you can upgrade directly to Dynamics NAV 2015:

    http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-components-postattachments/00-10-56-97-14/Upgrading-NAV-2009-R2-or-NAV-2009-SP1-Database-to-NAV-2015.pdf

    And the newly released blog post:

    http://blogs.msdn.com/b/nav/archive/2015/02/23/upgrading-from-microsoft-dynamics-nav-2009-r2-or-microsoft-dynamics-nav-2009-sp1-to-microsoft-dynamics-nav-2015.aspx

    If you upgrade from an earlier verison thaan descirbed here, you have to first upgrade to Dynamics NAV 2009 SP1.

    Be careful with the not compiled objects and the way data were stored in the older versions, as mentioned before in this document.

     

    As I mentioned before, and that the amount of information is too big to be written in one blog, I will stop here, and complete the rest of the tricks in a future post.

    Abdelrahman Erlebach

    Microsoft Dynamics NAV Support EMEA

  • Microsoft Dynamics NAV Team Blog

    Article for Posting Date on Adjustment Value Entry

    • 0 Comments

    We have published a technical article with guidance for users of the Inventory Costing functionality in Microsoft Dynamics NAV. More specifically, it provides guidance on how the Adjust Cost - Item Entries batch job identifies and assigns a posting date to the value entries that the batch job is about to create. We hope that this will answer some of the questions that people have about this functionality, including how the batch job has been enhanced since the introduction of Inventory Costing in version 3.0.

    You can find the technical article in the MSDN Library in English only here: Posting Date on Adjustment Value Entry

    For now, this is the only technical article in the MSDN Library. We hope to be able to publish other articles in the future.

     

    Best regards,

    Helene and Eva

    The Dynamics NAV team

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 20 for Microsoft Dynamics NAV 2013 R2 has been released

    • 0 Comments

    Cumulative Update 20 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:

    •   AU - Australia
    •   AT - Austria
    •   BE - Belgium
    •   CH – Switzerland
    •   CZ – Czech Republic
    •   DE - Germany
    •   DK - Denmark
    •   ES - Spain
    •   FI  - Finland
    •   FR - France
    •   IS - Iceland
    •   IT - Italy
    •   NA - North America
    •   NL - Netherlands
    •   NO - Norway
    •   NZ - New Zealand
    •   RU – Russia
    •   SE - Sweden
    •   UK - United Kingdom

    Where to find Cumulative Update 20

    You can download the cumulative update from KB 3069271  – Cumulative Update 20 for Microsoft Dynamics NAV 2013 R2 (Build 41371). 

    Additional Information

    For more information about cumulative updates for this version, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2.

    For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2013 R2

    For a list of all hotfixes included in cumulative updates for this version, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 27 for Microsoft Dynamics NAV 2013 has been released

    • 4 Comments

    Cumulative Update 27 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: 

    • AU - Australia
    • AT - Austria
    • BE - Belgium
    • CH - Switzerland
    • DE - Germany
    • DK - Denmark
    • ES - Spain
    • FI - Finland
    • FR - France
    • IS - Iceland
    • IT - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway
    • NZ - New Zealand
    • SE - Sweden
    • UK - United Kingdom

    Where to find Cumulative Update 27

    You can download the cumulative update from KB 3069230 - Cumulative Update 27 for Microsoft Dynamics NAV 2013 (Build 41354).

    Additional Information

    For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2013

    For a list of all hotfixes included in cumulative updates for this version, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource:

Page 1 of 51 (764 items) 12345»