• Microsoft Dynamics NAV Team Blog

    Using Web Services to Access Microsoft Dynamics NAV 5.0

    • 49 Comments

    Introduction

    Dynamics NAV 2009 contains a new subsystem for dealing with Web Services. This feature has been well received by partners and customers alike. Partners have expressed interest in having web services available for earlier versions of Dynamics NAV. This feedback resulted in a technology talk at Directions2007 in Florida, where the topic was what could be done to day. The conclusion of the talk was that everything we where intending to deliver was already possible today, yes some code is needed but strictly from function/feature perspective all of it is possible, and it is not even all that ugly. Dynamics NAV 2009 will provide out-of-the-box programmatic web service access to the application and will therefore remove the need for this additional technology plumbing described here.

    I have to say that the response to my talk has been tremendous. After the response to my talk on Web Services in NAV 5.0 and previous versions I decided to write this blog post and make the source files available.

    This post is about how to bridge the gap between the need for web services now and the current platform, it will help you understand how you can provide Web Services directly from Dynamics NAV today, in a “simple” and flexible way, already today.

    To work with the samples in this post you will need: Visual Studio 2005, Dynamics NAV 5.0 and .Net 3.0 installed on your system. This sample should work on Dynamics NAV 4.0 to but has not been tested on that version.

    Architecture

    The system we will build contains 4 different components/moving parts: Web Service Listener, Event Dispatcher, Codeunit Eventhandler and XMLPort for stream handling.

    image

    Web Service Consumer

    Any client that understands how to communicate with Web Services; like InfoPath, Visual Studio, SharePoint or any custom application written by you.

    Port

    Is the physical communication port that the WCF listens to.

    WCF Web Service

    Defines the data contracts and service contracts for the Web Service, it also implements the concrete service and opens for listening in the WCF subsystem, it then delegates the requests to the COM Event Dispatcher component.

    COM Event Dispatcher

    This component provides the hookups for Dynamics NAV, both to activate the service and to register event sinks. It defines 2 IDispatch interfaces the IServiceEvents and the IWebServiceListner, as well as the concrete implementation of the IWebServiceListner in the WebServiceListner class that provides the actual code for hooking up the WCF Web Service to Dynamics NAV.

    .NET

    We are using the CLR runtime for writing our Web Service component and our COM plugin. Some of this blog entry is about interop between Dynamics NAV and .NET through COM.

    Codeunit Event Handler

    Is responsible for starting up the WCF Web Service through the COM interface, it then registered for events coming from the WCF Web Service Component. The events routed to XMLPort for processing.

    XMLPorts for datastreams

    It deals with the actual business logic and data coming from or going to the Web Service.

    Implementation

    The implementation is in 2 programming languages: C# and C/AL.

    Please take a look at the provided code sample, for the rest of the information contained in the posting. It can be found here: http://code.msdn.microsoft.com/nav/Release/ProjectReleases.aspx?ReleaseId=896

    I have included comments in the code that should explain what is going on, if you feel something is missing, first look at the documentation for the WCF or post a comment to this post and I will try to answer it.

    Deployment of Sample

    To deploy the sample you will first have to download it, unpack it.

    Then open it up with Visual Studio and compile.

    Then import the codeunit.txt and xmlport.txt into your NAV installation and compile those objects, starting with the XMLPort

    To run the service simply open the Object Designer in NAV, find the Codeunit that you just imported and press run.

    There is no dependency on IIS or other external components. No further deployment steps should be needed.

    In the Visual studio solution is a ConsoleTestApp project. After you have followed the steps above you can run that project, it will test if your install was successful, as well as provide sample on how to use the web service.

    Special considerations

    In this sample I’m using XMLPort to handle the XML stream that is provided.

    You can take many different approaches to this, and still reuse large please of the code provided in the sample.

    To use the XMLPort as handler you will have to set the encoding property to UTF-8. This is due to a null termination bug in stream handler in NAV.

    image

    image

    With this approach you can already today, incorporate web services in your projects in straightforward way.

    The appropriate usage is whenever you need to give external application access to Dynamics NAV data or business process.

    For any questions or comments please feel free to ask them in the comment section of this blog post.  I will answer questions to best of my ability on this post in the comments section as well.

    One last thing:  This is a sample code.  It has not been tested, you should thoroughly test this code before usage.

    Best regards,
    Kris Rafnsson

  • Microsoft Dynamics NAV Team Blog

    Upgrade Toolkit for Upgrading Data from Microsoft Dynamics NAV 2009 R2 and Microsoft Dynamics NAV 2009 SP1 to Microsoft Dynamics NAV 2013 R2

    • 49 Comments

    The components needed to upgrade data directly from Microsoft Dynamics NAV 2009 R2 to Microsoft Dynamics NAV 2013 R2 are now available for download.

    Download the upgrade toolkit from PartnerSource or from CustomerSource

    In order to use the toolkit to upgrade data from Microsoft Dynamics 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you will also need the Microsoft Dynamics NAV 2013 development environment and Microsoft Dynamics NAV 2013 R2.

    At the Directions EMEA conference in Vienna and the Directions US conference in Nashville, we said that we have a team that is focusing on the Microsoft Dynamics NAV upgrade story. Going through the big transformation from the classic stack to the new product architecture in Microsoft Dynamics NAV 2009 was not easy and is challenging many customers and partners. So for our team, it is essential that the final outcome of our work is that each upgrade is easier, requires significantly less effort, and that it does not disrupt the daily business for our customers.

    In Microsoft Dynamics NAV 2013 R2, we introduced support for converting a Microsoft Dynamics NAV 2013 database so that you can run an application that was created in Microsoft Dynamics NAV 2013 on the Microsoft Dynamics NAV 2013 R2 platform, also known as a technical upgrade.

    Note: We strongly recommend that you upgrade the application objects as well so that your solution includes the important application fixes and new functionality that is introduced in Microsoft Dynamics NAV 2013 R2.

    Secondly, you can fully automate the data upgrade process using the Windows PowerShell scripts that we included in the Microsoft Dynamics NAV 2013 R2 product media. Historically, this process has been known for its tediousness and high risk of human error when multiple operations had to be executed consecutively in all companies of the database that you were upgrading. The scripts automate this work so that you can test and execute your data upgrades more reliably.

    Now with this delivery, we introduce an upgrade toolkit for upgrading the data from Microsoft Dynamics NAV 2009 R2 to Microsoft Dynamics NAV 2013 R2. This significantly simplifies the upgrade process for those of you coming from Microsoft Dynamics NAV 2009 R2 – or Microsoft Dynamics NAV 2009 SP1.

    Included in the new upgrade toolkit are all known data upgrade-related application hotfixes that we are aware of, and we also addressed several platform issues that affected the upgrade scenario.

    Note: You must download the latest Microsoft Dynamics NAV platform hotfixes before you start using the upgrade toolkit. The required hotfixes for Microsoft Dynamics NAV 2013 are available in the latest hotfix rollup, which you can download from PartnerSource or CustomerSource. For Microsoft Dynamics NAV 2013 R2, you can download the required hotfixes from PartnerSource or CustomerSource.

    When you download the new upgrade toolkit from the link above, you can use it to simply your upgrade process. Here are the main steps in upgrading from Microsoft Dynamics NAV 2009 R2 (or Microsoft Dynamics NAV 2009 SP1) by using the new upgrade toolkit.

    Note

    Before you start, make sure that you use the latest platform binaries for all versions of Microsoft Dynamics NAV in this process. For more information, see the following pages for the latest updates to the versions of Microsoft Dynamics NAV:

    Microsoft Dynamics NAV 2009 R2: Overview of Released Platform Hotfixes for Microsoft Dynamics NAV 2009 SP1 and Microsoft Dynamics NAV 2009 R2.

    Microsoft Dynamics NAV 2013: Released Cumulative Updates for Microsoft Dynamics NAV 2013.

    Microsoft Dynamics NAV 2013 R2: Released Cumulative Updates for Microsoft Dynamics NAV 2013 R2.

    To upgrade data from a Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database

    1. In the Microsoft Dynamics NAV  2009 R2 or Microsoft Dynamics NAV  2009 SP1 development environment (Classic client):
      1. Make sure that all table objects have compiled successfully. During compilation, Microsoft Dynamics NAV generates or regenerates the BLOB content in the Object Metadata table that is used in the later steps.  In the Tools menu, choose Build Server Application Objects.
        Note: You must also do this if you upgrade from Microsoft Dynamics NAV 2013 to Microsoft Dynamics NAV 2013 R2 . All tables must be compiled Microsoft Dynamics in NAV 2013 before you start upgrading to Microsoft Dynamics NAV 2013 R2.
      2. Create a copy or a backup of your old Microsoft Dynamics NAV 2009 R2 database, and open it in the Microsoft Dynamics NAV 2009 R2 development environment.
      3. Add your partner license to the database.
        You can do this by selecting the Save License in Database field in the Alter Database window. If the field was not already selected, a dialog box opens so you can specify the location of your partner license.
        If the field was already selected, upload the partner license from the License Information window.
      4. Open the Object Designer, and then import Upgrade601701.1.fob. If the .fob file contains objects with conflicting versions that are already in the database, the Import Worksheet window opens. Choose Replace All.
      5. For each company in the database, open the company, and make the relevant changes to data. For more information, see Task 3: Data/Object Changes Prior to Step 1 in the MSDN Library.
    2. Then, from the Object Designer, run form 104001, Upgrade - Old Version. Choose the Transfer Data button. Repeat this action for each company in the database. 
      Note
      We strongly recommend that you back up the database using SQL Server management tools after this step. 
    3. When you have transferred all data for all companies, in the Upgrade - Old Version window, choose the Delete Objects button.
      This action deletes all objects in the database that are not tables, but also obsolete tables that belong to functionality that is not available in Microsoft Dynamics NAV 2013 R2.
    4. Uninstall Microsoft Dynamics NAV 2009 R2, and then install Microsoft Dynamics NAV 2013.
      Note
      You do not have to install the full Microsoft Dynamics NAV 2013 product to perform the following database conversion. Instead, you can create a folder with the following files from the Microsoft Dynamics NAV 2013 product media:
      • Finsql.exe
      • Fin.stx
      • Fin.etx
      • CRONUS.FLF
      • Ndbcs.dll

      You can then use the Finsql.exe file to perform the conversion.  

    5. Change the compatibility level of your database. For SQL Server 2008 and SQL Server 2008 R2, verify that the compatibility level of the database is set to 100. For SQL Server 2012, set the compatibility level to 110.
    6. In the Microsoft Dynamics NAV 2013 development environment, open the Microsoft Dynamics NAV 2009 R2 database and agree to convert the database. The database has now been technically upgraded to Microsoft Dynamics NAV 2013.

      Note 
      During this step, Microsoft Dynamics NAV converts all text and code fields to Unicode format by changing their SQL Server data type. This conversion requires more disk space than usual, since both the database and the log file will grow in size considerably. It can also be a lengthy process.

      If your Microsoft Dynamics NAV 2009 R2 database is using SQL Server Collation, within the same step the collation will be changed to a suitable Windows collation. This is because Microsoft Dynamics NAV 2013 and higher versions only support Windows Collation. If you converted your database using the RTM version of Microsoft Dynamics NAV 2013, you may be experiencing collation-related issues after this conversion. Therefore it is strongly recommended to use the latest available version of Microsoft Dynamics NAV 2013 development environment to perform this step.

      Note
      We strongly recommend that you take a full SQL Server backup at this stage when the database conversion has completed.

    7. Uninstall Microsoft Dynamics NAV 2013, and then install Microsoft Dynamics NAV 2013 R2.
    8. In the Microsoft Dynamics NAV 2013 R2 development environment:
      1. Open the Microsoft Dynamics NAV 2013 database and agree to convert the database.
      2. Compile the system tables. You can find the tables by setting a filter for table ID 2000000004..2000000130.
        In the following step, you will be connecting a Microsoft Dynamics NAV Server instance to the database. 
    9. Make sure that the service account that the Microsoft Dynamics NAV Server instance uses has the db_owner role for the database. 

      Note 
      If you are upgrading a large database, such as a database size of more than 20-25 GB, make sure that you increase the timeout value in the Microsoft Dynamics NAV Server configuration file. In the CustomSettings.config file, the value is defined in the SQL Command Timeout node. The default value is 10 minutes, which is sufficient in the normal day-to-day work. However, during an upgrade that can take several hours depending on the size of the tables, you must increase the timeout period.

    10. Connect the Microsoft Dynamics NAV Server instance to the database, and then start the service instance.
    11. In the Microsoft Dynamics NAV 2013 R2 development environment:
      1. On the Tools menu, open Options, and then, make sure that the Prevent data loss from table changes field is set to Yes.You must also make sure that the Server Name, Server Instance, and Server Port fields are filled in.
        This ensures that the Microsoft Dynamics NAV Server instance that is connected to the database will verify that no operation will cause loss of data in the development environment.
      2. Import all customized objects in .fob format into the upgraded database. If the .fob file contains objects with conflicting versions that are already in the database, the Import Worksheet window opens. Choose Replace All.
      3. Make sure all objects are compiled.

        Important
        It is very important that at least all table objects have successfully compiled before you proceed.

      4. Import Upgrade Step 2 objects from the Upgrade601701.2.fob file.If the .fob file contains objects with conflicting versions that are already in the database, the Import Worksheet window opens. Choose Replace All.
    12. Perform the database schema synchronization by running the Sync-NAVTenant Windows PowerShell cmdlet in the Microsoft Dynamics NAV 2013 R2 Administration Shell (run as administrator).

      Note
      When you upgrade from one version to another, this typically involves numerous changes in the structure of the Microsoft Dynamics NAV tables (the object metadata). Database synchronization ensures that these changes in the metadata are applied to the corresponding tables in SQL Server. For example, it changes columns dimensions and data types, drops and create indices, drops and creates indexed views (V-SIFT), creates new tables, columns, and so on.

      When the number of changes is high, such as comparing Microsoft Dynamics NAV 2009 R2 to Microsoft Dynamics NAV 2013 R2, this synchronization can become a lengthy and resource consuming task.

      Database synchronization is triggered upon any request to Microsoft Dynamics NAV Server, such as when you start a client or run a windows Powershell cmdlet. Microsoft Dynamics NAV Server checks if metadata has changed since the last synchronization by comparing the content of the Object Metadata and Object Metadata Snapshot system tables. If a change is found, the synchronization procedure is initiated.  

      When the synchronization process has started, it is essential that you wait for it to complete or rollback (in case of an error or time-out). If you’re running a client, do not confirm or click anything client side. If you’re running the Sync-NAVTenant cmdlet, wait for it to complete and return control to the Windows PowerShell command prompt.

      Do NOT stop the Microsoft Dynamics NAV Server service at this point since there are high chances that the database synchronization transaction is still running.

      1. Run Microsoft Dynamics NAV 2013 R2 Administration Shell as Administrator. This opens a PowerShell prompt where the Microsoft Dynamics NAV cmdlets are available.

      2. Run the synchronization command against your upgrade database as follows: 

        Sync-NAVTenant –ServerInstance <MyNAVServerInstance> 

      3. Wait until the cmdlet returns control to the Windows PowerShell window.

    13. Open the Microsoft Dynamics NAV 2013 R2 Windows client to verify that you are connected to the Microsoft Dynamics NAV Server instance that is connected to the database being upgraded. 
      Next, you will run Upgrade Step 2 in each company in the upgraded database. You can get a list of all existing companies in the database by running the Get-NAVCompany cmdlet and passing as an argument the Microsoft Dynamics NAV Server instance which is connected to the upgraded database. 
      You will run objects directly from the development environment, so you must specify the company that the objects must run in in the Options window.
    14. In the Microsoft Dynamics NAV 2013 R2 development environment:
      1. On the Tools menu, open Options, and then, in the Company field, specify the name of the first company.
      2. In the Object Designer, find page 104002 Upgrade - New Version, and then choose Run.
      3. In the Upgrade - New Version window, choose Test Database Connection to make sure that the C/AL code that is triggered by the actions on the page has access to the database.
        If your database is on a named SQL Server instance, you must specify the full name in the SQL Server Name field.  
      4. Choose Transfer Data.
        If the process is successful, and you don't have to revisit the upgrade logs, you can clean the content of the Upgrade Time Log  table. 
      5. On the Navigate tab, choose Time Log, and then, in the Upgrade Time Log page, delete all records.
      6. Close the Upgrade - New Version window, and then close the Microsoft Dynamics NAV Windows client.
    15. Repeat step 14 for each remaining company in the database.
    16. When you have successfully transferred data in the last company, you must upgrade data that is common to all companies in the database, such as permissions, permission sets, web services, profiles and control add-ins.
    17. Upgrade data common to all companies such as permissions, permission sets, web services, profiles and control add-ins.
      If the customer has changed the Read/Write/Modify/Delete/Execute settings for any of the standard permissions, or customized default permission sets in any way, you must merge these changes into the default permissions sets and permissions that are included in Microsoft Dynamics NAV 2013 R2. You can use XMLport 104001 Import/Export Roles and XMLport 104002 Import/Export Permissions to export the new default roles and permissions from the CRONUS International Ltd. demonstration database in Microsoft Dynamics NAV 2013 R2. You can add control add-ins in the Control Add-ins window in the Microsoft Dynamics NAV Windows client. For more information, see How to: Register a Windows Client Control Add-in. For example, the following client control add-ins are available from the Microsoft Dynamics NAV 2013 R2 product media:
      • Microsoft.Dynamics.Nav.Client.BusinessChart
      • Microsoft.Dynamics.Nav.Client.PageReady
      • Microsoft.Dynamics.Nav.Client.PingPong
      • Microsoft.Dynamics.Nav.Client.VideoPlayer
    18. Delete the upgrade toolkit objects.
      1. In the Upgrade - New Version window, choose Mark/Delete Upgrade Toolkit.
        This deletes all upgrade toolkit objects, except tables
      2. In the Microsoft Dynamics NAV development environment, delete the upgrade tables by setting a field filter for objects where the Version List contains Upgrade Toolkit Table - marked for deletion.

    The database has now been through a data upgrade to Microsoft Dynamics NAV 2013 R2.

    Best regards,

    The Microsoft Dynamics NAV Service Experience team

    -----Blog post updated in May 2014-----

     

  • Microsoft Dynamics NAV Team Blog

    Important Information: In a live database with active users connected, changing an object multiple times or compiling all objects can cause data loss in NAV 2013 R2

    • 38 Comments

    You may experience data loss in Microsoft Dynamics NAV 2013 R2 in the following situations, separately or in combination:

    • Changing an application object more than once, for example by two different developers, in the same database connected to the same Microsoft Dynamics NAV Server instance while users are working in the system.
    • Compiling all application objects, and thereby potentially changing objects more than once, in a database that is connected to a Microsoft Dynamics NAV Server instance that users are accessing.

    To avoid the problem, we advise that you work according to the following best practices:

    • Application developers must be working on their own database and connect to their own Microsoft Dynamics NAV Server instance. When you deploy changes to the live production database, make sure that no users are working in the system.
    • You must compile objects only when no users are working in the system, including users connecting through NAS. 

    With update rollup 5 for Microsoft Dynamics NAV 2013 R2 - KB 2937999, this issue has been fixed and you do not have to take the precautions described above. However, we still advise that you separate development from production databases.

    Please note that implementing update rollup 5 will require a database conversion.

     

     

  • Microsoft Dynamics NAV Team Blog

    The New Table Synchronization Paradigm in Microsoft Dynamics NAV 2013 R2

    • 34 Comments

    Microsoft Dynamics NAV 2013 R2 was dispatched with a brand new feature that introduces big challenges to all of the Microsoft Dynamics NAV channel: Multitenancy. In simple words, multitenancy allows partners to deal with hosting scenarios on-premises and in cloud services in an easier and more flexible way than in the past.

    Before Microsoft Dynamics NAV 2013 R2, partners and customers could only use a single-tenant scenario (here also called Legacy mode).

    Below a short explanation how table synchronization used to work in earlier versions.

    Microsoft Dynamics NAV 2009 / Microsoft Dynamics NAV 2013

    1. At object import/compile, C/SIDE checks the Object Metadata version in working memory and compares it to the version in Object Metadata table to decide if and what kind of change is made.
    2. Schema changes are DIRECTLY APPLIED to the SQL Server database by C/SIDE if there is no breaking schema change, otherwise an error will be thrown by C/SIDE depending on SQL Server error catch.
    3. Object Change Listener is checking for changes in metadata, then updating Microsoft Dynamics NAV Server Cache with data from Object Metadata table if the change was detected.

    A synchronization failure would typically be reported with an error like “The Object Metadata does not exist. Identification and values … “ when running the Microsoft Dynamics NAV Windows client.

    The multitenancy feature has also changed the design how Microsoft Dynamics NAV developers has to deal with object changes, overall related to table objects. Multitenancy implies that the table structure definition has to be stored in the application database and this needs to be applied on one or more separate storage databases called Tenants. From a development perspective, this means that any modification that are made to a table object in C/SIDE are NOT DIRECTLY applied to the SQL Server structure but there is a need of performing a secondary action to apply and made persistent these modification at SQL Server side: this process is called Synchronization. Microsoft Dynamics NAV 2013 R2, then, comes with a time decoupling between table metadata creation (C/SIDE) and data structure changes (SQL Server).

    In order to simplify the current design, the Microsoft Dynamics NAV development team decided to handle single- and multitenant scenarios in the same way (roughly speaking a single-tenant / Legacy mode is handled as a multitenant scenario with a single tenant database constantly mounted against an application database).

    Below a short explanation how this is working in practice.

    Microsoft Dynamics NAV 2013 R2

    SCENARIO 1:

    • Single-tenancy / Legacy mode
    • “Prevent data loss from table changes” = Yes (default):

     

    1. At object import/compile, C/SIDE checks the Object Metadata version in working memory and compares it to the version in Object Metadata table to decide if and what kind of change is made. (Same as in Microsoft Dynamics NAV 2009 and Microsoft Dynamics NAV 2013)
    2. C/SIDE then CALLS THE Microsoft Dynamics NAV Server to check for breaking schema changes in SQL Server structure.
      If C/SIDE is unable to call the Microsoft Dynamics NAV Server or if a breaking schema change is attempted (action that cannot performed due to the current SQL Server structure such as deleting a field containing data): a C/SIDE error is reported accordingly and changes to Object Metadata table will not be committed.
      If it is evaluated as not attempting a breaking schema change in SQL Server then metadata from C/SIDE working memory is saved and committed to Object Metadata table.
      PLEASE NOTE: at this stage NO CHANGES ARE MADE TO THE SQL SERVER DATA STRUCTURE.
    3. When prompting for SYNCHRONIZATION, Microsoft Dynamics NAV Server then compares Object Metadata table with Object Metadata Snapshot table content. Any difference in the value for the “Hash” field is a flag to Microsoft Dynamics NAV Server that a change exists and should be subsequently applied physically SQL Server side as structural changes.

    Prompting for Synchronization happens when

    -         Performing ANY Microsoft Dynamics NAV client action.

    For example, if a user opens a Microsoft Dynamics  NAV Windows client, then Microsoft Dynamics NAV Server is starting applying the relevant structure changes to SQL Server, and the Microsoft Dynamics NAV Windows client is not shown until all the changes are done on SQL Server side.

    OR

    -         Running the Sync-NAVTenant Windows PowerShell cmdlet.

    SCENARIO 2 (DEPRECATED):

    • Single-tenancy / Legacy mode
    • “Prevent data loss from table changes” = No (Manually opted, not persistent)

    IMPORTANT NOTICE:

    Setting the “Prevent data loss from table changes” C/SIDE switch to “No” has been intended to be used as last resource in a pure multitenancy scenario and in Test or Staging environments when partners does not have any business data database mounted against the application database. All other usages that deviate from this statement might lead to unpredictable results and even undesired data loss scenarios in upgrades or, even worse, production environments.

    Never change for any reason this parameter to “No” when developing against a single-tenant / Legacy mode database.

    1. At object import/compile: C/SIDE checks the Object Metadata version in working memory and compares it to the version in Object Metadata table to decide if and what kind of change is made. (Same as in Microsoft Dynamics NAV 2009 and Microsoft Dynamics NAV 2013)
    2. C/SIDE DOES NOT CHECK FOR ANY BREAKING SCHEMA CHANGES IN SQL SERVER but simply FORCES COMMIT of metadata from C/SIDE cache TO the Object Metadata table.
    3. When prompting for SYNCHRONIZATION, Microsoft Dynamics NAV Server then compares Object Metadata table with Object Metadata Snapshot table content. Any difference in the value for the “Hash” field is a flag to Microsoft Dynamics NAV Server that a change exists and should be subsequently applied physically SQL Server side as structural changes.

    Since no validation is made against SQL Server (“Prevent data loss from table changes” was set to “No”) there might be chances that this will result in:

    • Data Loss
      There are few specific cases where data is dropped in this scenario:
      • The primary key is detected as being no longer unique
      • Data per Company is changed from Yes to No and more than one company contains data
      • One or more fields are deleted
      • One or more field data type is/are changed
    • Missing Synchronization
      Activities cannot be completed since SQL Server prevents these actions that would break the data structure and therefore no Microsoft Dynamics NAV Windows client or Web client can connect to the database. The partner or customer has to resolve these missing synchronization issues before moving forward or fall back to a backup where these issues does no longer exists

    SCENARIO 3:

    • Multitenancy
    • “Prevent data loss from table changes” = Yes (default):

    Same as Scenario 1 for point 1. and point 2.

    When prompting for SYNCHRONIZATION, changes will be triggered and applied to the SQL Server data structure.

    Prompting for synchronization in a pure multitenant deployment happens when

    -         Performing ANY Microsoft Dynamics NAV client action

    OR

    -         Running the Sync-NAVTenant Windows PowerShell cmdlet

    OR

    -         Mounting a tenant database

     

    Based on the scenario depicted above, there might be risks of data loss and/or missing synchronization issues if handling C/SIDE development (namely dealing with Table objects) in a way that deviate by the prospected paradigm.

    Data loss issues:

    These might arise typically in one of the following scenarios:

    • Direct removal of rows from the Object Metadata table in SQL Server
    • Stretched / Borderline scenarios that implement platform files with a Build No. lower than 36281 KB 2934571 as described in this blog post.

     

    Synchronization issues:

    These might arise typically in one of the following scenarios:

    • The Microsoft Dynamics NAV Server service account has insufficient permissions
      The service account must be added to “db owner” SQL Server role for the Microsoft Dynamics NAV tenant Database.
    • Stretched / Borderline scenarios that implement platform files with a Build No. lower than 36281 KB 2934571 as described in this blog post.
      With a lower build number, you might get into one of the following scenarios:
      • When several developers commit changes at the same time in the same database / tenant while synchronization is running, this might lead to metadata corruption. (Object Metadata table now is locked for committing  changes).
      • Doing actions like FOB Import > Replace > SaveAs  and then Import again the saved FOB was causing a metadata corruption.
    • SQL Connection Timeout meanwhile performing an operation, such as when SQL Server schema changes require drop and build of indexes on large tables.
      To resolve this issue it is necessary to increment the following parameter in the Microsoft Dynamics NAV Server CustomSettings.config file
       <add key="SqlCommandTimeout" value="10:00:00" />

    Development Environment best practice

    thinking about potential data loss and synchronization issues is a brand new big challenge in the development environment, and so some consideration and following best practice might be advisable. These applies to developing solutions for both single- and multitenant deployments.

    1. Do not use Build No. lower than than 36310 KB 2934572
      As a partner, you take this as the "RTM Build No." starting point for NAV 2013 R2 and deploy this platform hotfix in the future projects while you also convert existing installations.
      NOTE: As per common best practice, we recommend that you download / request / test and deploy the latest platform hotfix for Microsoft Dynamics NAV 2013 R2. This will contain correction for minor issues not directly or just slightly related to synchronization scenarios.
    2. Never-ever change “Prevent data loss from table changes” to “No”.
      This have been noticed as one of the major source of potential data loss and missing synchronization for NAV 2013 R2 databases.
    3. Make sure that the Microsoft Dynamics NAV Server service account has been granted the “db owner” role in SQL Server.
    4. Increment the SQL Server Command Timeout parameter in the Microsoft Dynamics NAV Server configuration file that you use in development to a very high value (such as 10:00:00)
    5. For large Microsoft Dynamics NAV objects OR a high number of table modifications, do NOT use a Microsoft Dynamics NAV client action to prompt for synchronization but it is warmly preferable to use the Sync-NAVTenant Windows PowerShell cmdlet. (This is a typical scenario related to upgrades).
    6. For big batch of FOB files that are making a high number of table modifications, be sure to have this tested on a safe staging environment and import, where possible, the Table Objects in smaller chunks and synchronize them after importing every single chunk of Microsoft Dynamics NAV objects.
    7. For important changes in several table structures, such as when upgrading from previous version, it would be good to run a SQL Server Profiler trace after prompting for synchronization to check what is running on the SQL Server side and keep the synchronization monitored until it ends.

    Recommended Events:

    • SP:StmtCompleted
    • SQL:StmtCompleted

    Recommended Column Filters:

    • DatabaseName   Like <DatabaseName>
    • TextData       Not Like  SELECT %

    Bottom line. Worth mentioning that if a Microsoft Dynamics NAV Client hang / disconnect happens due to a missing synchronization issue or there were a synchronization transaction running behind the transaction rollback SQL Server side will take a higher amount of time in comparison with the same committed transaction, depending on the type of changes, resources available, etc.

    Just in case you fall back in this situation, it is warmly advisable to do not stop nor restart Microsoft Dynamics NAV Server and check through a SQL Server Profiler trace and/or via SQL Server Management Studio if the transaction has successfully rollback.

    Another blog post will follow this one, related to synchronization challenges and best practice while upgrading to Microsoft Dynamics NAV 2013 R2 from previous versions.

     

    These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

     

    Gerard Conroy - Microsoft Dynamics UK

    Abdelrahman Erlebach - Microsoft Dynamics Germany

    Duilio Tacconi - Microsoft Dynamics Italy

    Jasminka Thunes - Microsoft Dynamics Norway                   

    Microsoft Customer Service and Support (CSS) EMEA

     

    A special thanks to Jorge Alberto Torres & Jesper Falkebo from the Microsoft Dynamics NAV development team

  • Microsoft Dynamics NAV Team Blog

    Update Rollups and Project Considerations for Upgrade, Maintenance and New Implementations

    • 29 Comments

    More and more partners are beginning to work with the update rollups. They find a lot of value in applying the latest application and platform fixes up front, instead of waiting for a customer to report those. Update rollups also simplify the way fixes are discovered and surfaced.

    So with this blog post, we want to provide a more detailed picture of the update rollups, their purpose, and their usage scenarios so that you are aware of the rollup release process and components, and so that more of you start using them. We would also like to provide our look at how to adopt and use the update rollups within various stages of the implementation project lifecycle.

    What is an update rollup?

    Update rollups are released monthly for Microsoft Dynamics NAV 2013 and Microsoft Dynamics NAV 2013 R2: 

    Released update rollups for Microsoft Dynamics NAV 2013 R2

    Released update rollups for Microsoft Dynamics NAV 2013

    An update rollup is a set of files that includes all hotfixes (application and platform) and regulatory features that have been released for the versions of Microsoft Dynamics NAV that are listed above. 

    They are cumulative, meaning that they include hotfixes and regulatory features that were released in the earlier update rollups for the specific product version.

    Each rollup contains the following:

    • Accumulated application change log (TXT format) compared to the originally release of the specific product version (the RTM release).
    • Application change log (TXT format) compared to the previous rollup - the “delta”.
    • Only the application objects that changed since the RTM version are included in the FOB and TXT files provided with the rollup.
    • Each application object is marked with rollup version number (version number + build number) to make it possible to see which objects have been changed in which rollup.
    • The latest version of all (not only the changed ones) platform components (executables and .dll assemblies). These components are also stamped with a version number and a build number.

    Application changes:

    Platform components:

    Hotfixes that are included in the update rollups do not always include translation. In that case, the translation for such changes are provided with the next RTM version of  Microsoft Dynamics NAV (major releases or minor release). Regulatory features included in the rollup are almost always translated; however, in rare cases the translation is provided with the following monthly update rollup.   

    Update rollups are currently released for 10 countries: Australia, Germany, Denmark, France, Italy, North America (Canada, US, Mexico), Netherlands, New Zealand, Sweden, United Kingdom.

    Local hotfixes for the following countries are currently not included in update rollups: Austria, Belgium, Switzerland, Spain, Finland, India, Iceland, Norway.

    Scenarios

    Maintenance. Applying rollups for the countries/regions where they are available.

    If you have a version of the running application for which you would like to apply the update rollup, you can follow this high level flow:

    • Find the latest rollup available for your application version here:
    • See the KB article for the UR to find the full list of application and platform changes as well as regulatory updates included in it. The list is divided by country/region. For instance, here are the KB articles for the latest available rollups:
    • Based on the urgency and relevance of the application and platform changes, current project stage, customer situation and other surrounding factors decide whether you want to apply the UR now, or wait for the next one. We strongly recommend that you always apply the latest UR to gradually reduce the amount of regressions, merging, issues and to be compliant with the latest regulatory requirements. 
    • If you are on the RTM version merge your application objects with all objects included with the latest rollup.
    • If you are on the URn version – filter out the objects which were changed since URn till the latest available UR and merge your application objects with those objects. You can use the Version List field to see in which rollup (build) they were changed. 

    Maintenance. Applying hotfixes for the countries where update rollups are not available.

    For these cases the process of applying the hotfixes and regulatory updates is the same as it was before the UR concept was introduced, namely the changes relevant to all countries/regions (W1 changes) should be applied one by one.

    However, URs can aid this process as well as you can obtain all W1 changes by downloading the latest W1 UR and merge them into your country version. You can find W1 URs by clicking at “Show additional information” and looking at their Fix Name which you can see when you download the UR:

    Platform components are country independent, therefore the platform updates can also be obtained from W1 UR and deployed for any country/region-specific version of Microsoft Dynamics NAV.

    Major releases, minor releases, and update rollups

    URs are different from the major and minor releases. Every major and minor release contains new application and platform features and functionality as well as hotfixes, while the URs only contain hotfixes and regulatory updates. So when a major release or minor release has been released, we create a new branch for the next release and continue to maintain both branches.

    Let’s dissect the process based on the Microsoft Dynamics NAV 2013 version as an example (see the illustration below).

    When Microsoft Dynamics NAV 2013 version was released, we created a new branch for Microsoft Dynamics NAV 2013 R2 development. As we’ve been building Microsoft Dynamics NAV 2013 R2 functionality, we kept fixing Microsoft Dynamics NAV 2013 and kept releasing URs for it.

    Relevant fixes from the Microsoft Dynamics NAV 2013 version were merged into the Microsoft Dynamics NAV 2013 R2 version in the course of its development. In many cases they had to be redesigned to fit the new code and new functionality of Microsoft Dynamics NAV 2013 R2.

    Therefore, when Microsoft Dynamics NAV 2013 R2 was released, not all fixes included in the latest available Microsoft Dynamics NAV 2013 UR were included in it. The process of finding and merging relevant fixes into the latest branch is a continuous process, and there will be a certain lead time until the fixes from the releases are synchronized between branches. So, for instance, the majority of the fixes which were available in Microsoft Dynamics NAV 2013 UR7 were included into Microsoft Dynamics NAV 2013 R2 UR1, and the process of merging of relevant fixes will go on.

    When considering upgrade or a new implementation of the new major release or minor release, we recommend that you always upgrade to (or start from) the latest available UR for it. If there is a particular hotfix which is available in the previous version of Microsoft Dynamics NAV, but it not yet available in the latest release, you can always request it to be merged there using the normal support process “How to create a new support case”.  It is also always possible to only update the platform components with the updated ones coming from a corresponding UR (technical upgrade), although the best practice would be to keep the application objects updated to the latest UR as well.

    Microsoft Dynamics NAV 2013 R2 hotfixes are also periodically merged into Microsoft Dynamics NAV 2013 and will be eventually available in the upcoming URs. Similarly, if there is a particular hotfix which is available in the current version of Microsoft Dynamics NAV, but it not yet available in the previous release, you can also request it to be merged there using the same support process “How to create a new support case”. 

    We will continue to release URs for the Microsoft Dynamics NAV 2013 release and future releases periodically, synchronizing relevant fixes between them over time.

    Microsoft Dynamics NAV 2009 SP1 and Microsoft Dynamics NAV 2009 R2 are maintained following the old process - you can request hotfixes on case by case basis, no update rollups available for those product versions. 

    The following timeline illustrates the process.

     

    Conclusion

    It is highly recommended to implement the update rollups. We look forward to hearing your feedback and suggestions to how this process could be made more convenient for you to assess and absorb the changes.

     

    Kind regards,

    Microsoft Dynamics NAV Team

     

    Updated on January 16, 2014: We removed two sentences that were misleading around the upgrade rollups and the Upgrade Toolkit. We apologize for the confusion.

  • Microsoft Dynamics NAV Team Blog

    Update Rollup 5 for Microsoft Dynamics NAV 2013 R2 has been released

    • 27 Comments

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

    With update rollup 5, local hotfixes for additional countries have been added, and update rollups for Microsoft Dynamics NAV 2013 R2 now include hotfixes that apply to all countries and hotfixes specific to the following local versions:

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

     

    Where to find update rollup 5

    You can download update rollup 5 from KB 2937999 - Update Rollup 5 for Microsoft Dynamics NAV 2013 R2 (Build 36281). Note: Implementing this update rollup will require a database conversion.

    The hotfixes that have been released since update rollup 4 are listed in KB 2937999. For a full list of all hotfixes included in update rollups for Microsoft Dynamics NAV 2013 R2, see the following CustomerSource and PartnerSource pages: 

    CustomerSource:

    PartnerSource

     

    More Information

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

  • Microsoft Dynamics NAV Team Blog

    Updated: How to log report usage

    • 27 Comments

    Updated: Now with links to both NAV 5.0 and NAV 2009 hotfixes

     /Claus Lundstrøm

    ******

    In several partners meetings I have heard this requests over and over again.

    Claus, when we are planning an upgrade of Classic reports to RDLC reports, we do not always know which reports are actually being used at the customer site. It would be great to be able to log which reports are used so we know exactly which reports we need to upgrade to RDLC.

    Well, if you download below hotfix you will now have the capability to log report usage at a customer site.

    Dynamics NAV 5.0: KB2575296

    Dynamics NAV 2009: KB2558650
    Find links to all NAV 2009 Platform Hotfixes here:
    CustomerSource: Overview of Released Platform Hotfixes for Microsoft Dynamics NAV 2009 SP1 and Microsoft Dynamics NAV 2009 R2
    PartnerSource: Platform Hotfixes for Microsoft Dynamics NAV 2009 SP1 and Microsoft Dynamics NAV 2009 R2

     

    In the following steps I have outlined which steps you need to do to get this log file. Remember above hotfix is required to perform the following steps.

    1. Create new table to be used for Log report usage:

    clip_image002

    OBJECT Table 50000 Report Log
    {
    OBJECT-PROPERTIES
    {
    Date=22-06-11;
    Time=14:19:58;
    Modified=Yes;
    Version List=CLAUSL;
    }
    PROPERTIES
    {
    }
    FIELDS
    {
    { 1 ; ;No. ;Integer ;AutoIncrement=Yes;
    MinValue=1 }
    { 2 ; ;User ID ;Code50 ;TableRelation="User Role"."Role ID";
    CaptionML=ENU=User ID }
    { 3 ; ;Report ID ;Integer ;CaptionML=ENU=Report ID }
    { 4 ; ;Report Name ;Text249 ;FieldClass=FlowField;
    CalcFormula=Lookup(AllObjWithCaption."Object Caption" WHERE (Object Type=CONST(Report),
    Object ID=FIELD(Report ID)));
    CaptionML=ENU=Report Name }
    { 5 ; ;Date Time ;DateTime }
    }
    KEYS
    {
    { ;No. ;Clustered=Yes }
    }
    FIELDGROUPS
    {
    }
    CODE
    {
    BEGIN
    END.
    }
    }

    2. Now with the table created for our Report Usage log please open Codeunit 1

    3. Open “C/AL Globals”

    4. Navigate to ”Functions”

    clip_image004

    5. Create new function with Name=”OnReportRun”

    clip_image006

    6. Open Properties and change ID to 120

    clip_image008

    7. Now open “Locals” and create parameter= ReportId with Type=Integer

    clip_image010

    8. Select Variables tab and create ReportLog

    clip_image012

    9. Now all we need is to write the code for this new trigger. Open C/AL Editor and navigate to the end.

    10. In OnReportRun write the following code:

    ReportLog."User ID" := USERID;

    ReportLog."Report ID" := ReportId;

    ReportLog."Date Time" := CURRENTDATETIME;

    ReportLog.INSERT;

    clip_image014

    11. Now Restart Classic Client

    12. Run a couple of reports

    13. And then at last run the Report Log table to see the result:

    clip_image016

    Yes I’m aware that this solution only works for Classic Reports, and yes I also would like a feature so it’s possible for you to log all objects being used at a customer site. For now we do not get this, but let’s see what the future brings.

    /Claus Lundstrøm

  • Microsoft Dynamics NAV Team Blog

    Importing and Exporting Data in Microsoft Dynamics NAV 2013 R2 CU 8

    • 23 Comments

    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.

    Exporting and Importing Data in the Microsoft Dynamics NAV Windows Client

    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.

    Windows PowerShell Cmdlets

    The following table describes the Windows PowerShell cmdlets that are new in Microsoft Dynamics NAV 2013 R2 Cumulative Update 8.

    Name

    Description

    Export-NAVData

    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.

    Import-NAVData

    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.

    Get-NAVDataFile

    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.

    Access

    Description

    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.

    Name

    Description

    Get-NAVCompany

    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:

    1. Export-NAVData -DatabaseName <string> -FileName <string> [-DatabaseServer <string>] [-ApplicationDatabaseServer <string>] [-ApplicationDatabaseName <string>] [-Description <string>] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [-CompanyName <string[]>] [-Force]  [<CommonParameters>]

    2. Export-NAVData [-ServerInstance] <string> [[-Tenant]< TenantId>] -FileName<string> [-Description <string>] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [-CompanyName <string[]>] [-Force]  [<CommonParameters>]

    3. Export-NAVData [-ServerInstance] <string> [[-Tenant] <TenantId>] -FileName<string> -AllCompanies [-Description <string>] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [-Force]  [<CommonParameters>]

    4. Export-NAVData -DatabaseName <string> -FileName <string> -AllCompanies [-DatabaseServer <string>] [-ApplicationDatabaseServer <string>] [-ApplicationDatabaseName <string>] [-Description <string>] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [-Force]  [<CommonParameters>]

     

    Refer to the following syntax for the Import-NAVData cmdlet:

    1. Import-NAVData [-FileName] <string> -DatabaseName <string> [-DatabaseServer <string>] [-ApplicationDatabaseServer <string>] [-ApplicationDatabaseName <string>] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [-CompanyName <string[]>] [-Force] [-WhatIf] [-Confirm]  [<CommonParameters>]

    2. Import-NAVData [-ServerInstance]< string> [[-Tenant] <TenantId>] [-FileName] <string> [-IncludeApplicationData] [-IncludeGlobalData] [-CompanyName <string[]>] [-Force] [-WhatIf] [-Confirm]  [<CommonParameters>]

    3. Import-NAVData [-ServerInstance]< string> [[-Tenant] <TenantId>] [-FileName] <string> -AllCompanies [-IncludeApplicationData] [-IncludeGlobalData] [-Force] [-WhatIf] [-Confirm]  [<CommonParameters>]

    4. Import-NAVData [-FileName] <string> -DatabaseName <string> -AllCompanies [-DatabaseServer <string>] [-ApplicationDatabaseServer <string>] [-ApplicationDatabaseName <string>] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [-Force] [-WhatIf] [-Confirm]  [<CommonParameters>]

     

    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:

    • MicrosoftDynamicsNAV2013R2CU8_ExportImportDataUsingNavDataFiles.pptx
    • MicrosoftDynamicsNAV2013R2CU8_ImportExportData.pdf

    In subsequent cumulative updates, the documents will be available in the country-specific downloads as well.

  • Microsoft Dynamics NAV Team Blog

    C/SIDE Improvements in Dynamics NAV 2009 R2

    • 21 Comments

    Microsoft Dynamics NAV 2009 R2 has several new features as part of the C/SIDE development environment. After several years (and releases) of building a strong new platform, we are able to refocus our efforts onto making fantastic developer focused features for C/AL developers. You can expect this trend to continue with even more in NAV "7" and further but without further ado, I'd like to introduce you to some of your newest friends...

    1. CTRL+F12

    Also known as Go-To-Definition, I'm sure you'll become intimately familiar with the keyboard shortcut rather than use the feature name! Go-To-Definition (or GTD to those of us too busy to spell things out properly) enables you to jump to code and open designers with an easy shortcut. GTD works on code context, which means that if you're on a Table variable and you do CTRL+F12 then the Table Designer will spring open and you can easily review field information or check properties. COOL!

    And if you're on a system trigger (like VALIDATE) and there is code in the Validate trigger, then CTRL+F12 will take you to that method! Awesome!

    Lastly, and by now this won't be much of a surprise, if you're on a user-defined function then pressing CTRL+F12 will take you to that code. Kapow!

    GTD doesn't work for rec or currform/currreport yet but we have room and time for improvements. Let us know if you'd like GTD to take you somewhere else in the app!

    And if you don't like shortcut keys, you can also access Go-To-Definition via right-click or through the View menu!

    Figure 1 - using Go-To-Definition on a Table variable will open Table Designer. Using it on a function will jump to the code for that function.

    2. Lock/Unlock of Application Objects

    Have you ever lost work because the developer sitting next to you modified the object you were currently working on? We can't restore your lost work but we can do something about losing more work in the future. Check out the two new fields in the Object Designer - Locked and Locked By. Now you can 'reserve' or place a lock on an application object and any subsequent developers will now get a 'read only' version of that application object. This means that other developers can still see the code but they can't save and overwrite your work.

    To make sure that no one loses work, a 'read only' object can still be saved and compiled, but you can't overwrite the original ID.

    Look for the client setting in Tools->Options called "Auto lock on Design" to make the feature activate automatically when you open an object.

    Figure 2 - Two users, userA and userB are working in the same database. UserA can see that userB has already locked codeunits 80 and 81 and is trying to lock Codeunit 82.

     3. Page Designer Improvements

    We've tweaked a couple of parts in Page Designer. Firstly, we completed the New Page Wizard so that it will now also offer you to pick factboxes for your pages. This was quite an oversight as factboxes make pages much more valuable than forms as you can include much more related information in them. Next, we changed the default naming of factboxes so that in the page you'll no longer see name and ID as <control20061721008> but instead see a much more readable name like <OutlookPart>. Nice!

    Figure 3 - FactBox picker in the New Page Wizard.

     4. Structure Highlighting

    Finding pages a bit hard to read? Need a microscope to see what's indented and what's not? We agree that it's hard to see where the structure is in pages and so we've introduced Structure Highlighting. Now any record (row) that is a container will be in bold. It's a simple change but it makes a huge difference to the readability of the pages. The bold lines break up the groups and the readability of the page is dramatically increased.

    Figure 4 - Structure Highlighting. Showing a simple example on a small page here because it's hard to include a large page. However, with the container lines highlighted, the overall structure of the page is more readable. And if the page had more containers (FastTab groups, Repeater sections), then they would stand out quite prominently.

    Recently Microsoft hosted a Hot Topic session that included the improvements discussed in this post. It is called  "Microsoft Dynamics NAV 2009 R2 Hot Topic: What's New for Developers." A recorded version of the session can be seen at the Partner Learning Center

    We hope you enjoy the new features and, as ever, if you have suggestions for improvement you're welcome to get in touch (either in comments, directly to me in email: sglasson@microsoft.com, or using the MSConnect feedback tool).

    Thank you!

    Stuart 

  • Microsoft Dynamics NAV Team Blog

    QR Codes for Microsoft Dynamics NAV

    • 20 Comments

    QR codes (abbreviated from Quick Response code) are appearing in many different places today, and they are found to be quick and efficient when it comes to working with mobile phones and other devices which can read them. QR Code is a multipurpose instrument and it can hold all sorts of different types of valuable information like your company’s or your salesperson’s contact details, sales invoice information, promotional codes, location information, checksums, amounts, web links etc., which you can read using a QR code reader to automate some of the routine manual processes, like typing in things manually. 

    The QR code is a two-dimensional data-matrix which can be decoded very fast. The format is clearly defined and published as an ISO standard.

    QR code

    As the Windows Phone 7.5 update, code name “Mango”, rolls out to customers, it makes it even more relevant to use the QR codes, as you can now use your Windows phone camera to scan QR codes by bringing them into camera view. Bing will recognize QR codes and will help you save and use the information encoded in it.

    In some countries, popularity of QR codes has grown so much, that their usage is now considered a national standard. Our team has recently released an update for the Mexican market, where we added QR codes to several major Microsoft Dynamics NAV documents. And we thought – why don’t we let everyone else enjoy this new cool feature?

    The update is available for NAV 5.0 SP1, NAV 2009 SP1 and NAV 2009 R2 versions of the product.

    URLs for Microsoft Dynamics NAV 2009 SP1 and R2:

    https://mbs.microsoft.com/customersource/downloads/taxupdates/MSDNAV2009SP1ElectronicInvoice_Mexico   

    URLs for Microsoft Dynamics NAV 5.0 SP1 :

    https://mbs.microsoft.com/customersource/downloads/taxupdates/MSDNAV5SP1ElectronicInvoice_Mexico

    However, the only part you need from it is the MXElectronicInvoice.msi file included in the package. Note that the .msi file is exactly the same for both versions of NAV.

    Here is what you have to do to get your data encoded into a QR code:

    1. Run the installer to deploy the dll we shipped for this update. Among other things, the dll includes QRCodeProvider  and IBarCodeProvider classes which we can use.

    2. Add a BLOB field which will be storing the QR Code image into the Sales Invoice Header table for example:

    3. Remember to set the SubType property to Bitmap if you would like to use the QR code on pages:

    4. You can now use the following code to generate a QR code image, which for demo purposes will be saved into a first found posted sales invoice (needless to say, you should be doing it on a test database ;) ) In this example we will encode a contact card with some predefined details.

    OBJECT Codeunit 50001 QR Code Mgt.
    {
      OBJECT-PROPERTIES
      {
        Date=;
        Time=;
        Modified=Yes;
        Version List=QR Code;
      }
      PROPERTIES
      {
        OnRun=VAR
                CompanyInfo@1170000004 : Record 2000000006;
                SalesInvoiceHeader@1170000003 : Record 112;
                TempBlob@1170000002 : Record 99008535;
                QRCodeInput@1170000000 : Text[1024];
                QRCodeFileName@1170000001 : Text[1024];
              BEGIN
                // Save a QR code image into a file in a temporary folder
                QRCodeInput := CreateQRCodeInput('John,Doe','+555 1231231','john@doe.zzz','www.johndoe.zzz');
                QRCodeFileName := GetQRCode(QRCodeInput);
                QRCodeFileName := MoveToMagicPath(QRCodeFileName); // To avoid confirmation dialogue on RTC

               // Load the image from file into the BLOB field
                CLEAR(TempBlob);
                ThreeTierMgt.BLOBImport(TempBlob,QRCodeFileName,FALSE);
                IF SalesInvoiceHeader.FINDFIRST THEN BEGIN
                  SalesInvoiceHeader."QR Code" := TempBlob.Blob;
                  SalesInvoiceHeader.MODIFY;
                END;

               // Erase the temporary file
                IF NOT ISSERVICETIER THEN
                  IF EXISTS(QRCodeFileName) THEN
                    ERASE(QRCodeFileName);

                MESSAGE('Done!');
              END;
      }
      CODE
      {
        VAR
          ThreeTierMgt@1170000001 : Codeunit 419;

        LOCAL PROCEDURE CreateQRCodeInput@1020046(Name@1020000 : Text[80];PhoneNo@1020002 : Text[80];EMail@1020003 : Text[80];URL@1170000000 : Text[80]) QRCodeInput : Text[1024];
        BEGIN
          QRCodeInput :=
            'MECARD:' +
            'N:' + Name + ';' +
            'TEL:' + PhoneNo + ';' +
            'EMAIL:' + EMail + ';' +
            'URL:' + URL + ';';
        END;

        LOCAL PROCEDURE GetQRCode@1020038(QRCodeInput@1020001 : Text[1024]) QRCodeFileName : Text[1024];
        VAR
          IBarCodeProvider@1020000 : Automation "{89F54BC4-E6C9-44BA-8574-86568625BFF8} 1.0:{9FE38730-1A3C-4B84-A8C2-AFAC6A90E641}:'Microsoft Dynamics Nav MX Services'.IBarCodeProvider";
        BEGIN
          GetBarCodeProvider(IBarCodeProvider);
          QRCodeFileName := IBarCodeProvider.GetBarCode(QRCodeInput);
        END;

        PROCEDURE GetBarCodeProvider@1020001(VAR IBarCodeProvider@1020000 : Automation "{89F54BC4-E6C9-44BA-8574-86568625BFF8} 1.0:{9FE38730-1A3C-4B84-A8C2-AFAC6A90E641}:'Microsoft Dynamics Nav MX Services'.IBarCodeProvider");
        VAR
          QRCodeProvider@1020002 : Automation "{89F54BC4-E6C9-44BA-8574-86568625BFF8} 1.0:{69FEA5E6-0A76-4555-B74B-F170956B0098}:'Microsoft Dynamics Nav MX Services'.QRCodeProvider";
        BEGIN
          IF ISCLEAR(QRCodeProvider) THEN
            CREATE(QRCodeProvider,TRUE,TRUE);
          IBarCodeProvider := QRCodeProvider;
        END;

        PROCEDURE MoveToMagicPath@1170000000(SourceFileName@1170000000 : Text[1024]) DestinationFileName : Text[1024];
        VAR
          FileSystemObject@1170000001 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{0D43FE01-F093-11CF-8940-00A0C9054228}:'Windows Script Host Object Model'.FileSystemObject";
        BEGIN
          DestinationFileName := ThreeTierMgt.ClientTempFileName('','');
          IF ISCLEAR(FileSystemObject) THEN
            CREATE(FileSystemObject,TRUE,TRUE);
          FileSystemObject.MoveFile(SourceFileName,DestinationFileName);
        END;

        BEGIN
        END.
      }
    }

    5. With the image saved in the BLOB field, it is now “business as usual” to add it to a report. You can see, for example, how company logo is added to the standard NAV document reports. NB. Don’t forget to run CALCFIELDS on the "QR Code" field before you display its content. :-)

    6. And finally – run the report to see the QR code which you or your customers can scan, for example, with your favorite  Windows 7.5 mobile phone:

     

    These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

     

    Best regards,

    Microsoft Dynamics NAV ERM Team

    Dmitry Chadayev, Program Manager

  • Microsoft Dynamics NAV Team Blog

    Integrating NAV 2009 R2 with CRM 4.0

    • 19 Comments

    With the release of NAV 2009 R2, we have endeavoured to prioritise features that many customers and partners have requested and this includes the ability to integrate NAV with CRM.

    The approach we have chosen to provide integration between NAV and CRM is to use an existing solution called the Connector for Microsoft Dynamics. This solution enables the integration of NAV 2009 R2 with CRM 4.0 online or on premise.

    As part of R2, we will provide out of the box support for synchronising common data such as customer, contact, sales order, and invoice, while also providing a means to enable synchronisation between any other standard or custom entities or fields that support specific business processes.

    Let's take a typical scenario where integration between CRM and NAV can really support a business process:

    The marketing manager uses CRM to manage her campaigns, opportunities and leads. When the leads are qualified they can be converted into a CRM Account. With integration enabled, this account subsequently becomes a customer in NAV. It's now possible for the sales team or customer service representatives to create orders in either CRM or NAV depending on their business process. The sales order will be integrated to NAV where the planning, payment processes, and shipping are handled, taking advantage of the core strengths of NAV.

    When R2 ships we will be providing as standard, integrations between the following entities:

    The Connector for Microsoft Dynamics uses web services to read and write data from CRM and NAV. It has two adapters for our solution that are designed to integrate with NAV 2009 R2 and with CRM 4.0. During configuration of the adapters, it is possible to specify which entities you want to integrate, which companies will be integrated, etc. so once the adapters are configured you can see a company-to-company integration with all the entities that you plan to integrate between the two systems.

    The entities are synchronised through the use of maps which indicate which field in NAV relates to which field in CRM. For example, Customer Name in the Customer table in NAV may relate to the Customer Name in the Account entity in CRM. The systems can be kept in synch on a schedule that works for each entity. So for example, it might be that you want to synchronise your customer information from NAV to CRM every hour but you may only want to synchronise item data from NAV to create products in CRM on a weekly basis.

    When the Connector runs, changes made to data in NAV that have been identified as data that will be integrated will trigger a field to be updated with a date/time stamp indicating that a change was made. The Connector can then query this date and look for changes via the web services since the last time the integration ran and write those changes to the destination system.

    To view a recorded version of the Hot Topic session about Integrating Microsoft Dynamics NAV 2009 R2 with CRM 4.0, see the Partner Learning Center.

    - Samantha Scott

  • Microsoft Dynamics NAV Team Blog

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

    • 19 Comments

    NOTE: The term “update rollup”, which has been used until now for hotfix releases, has been replaced with the term “cumulative update”. The meaning of the term is unchanged.

    Cumulative update 6 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
    • 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 (NEW)
    • SE - Sweden
    • UK - United Kingdom

    Where to find cumulative update 6

    You can download cumulative update 6 from KB 2955941 – Cumulative Update 6 for Microsoft Dynamics NAV 2013 R2 (Build 36366).

    Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.

    For a full list of all hotfixes included in cumulative updates for Microsoft Dynamics NAV 2013 R2, see the following CustomerSource and PartnerSource pages: 

    CustomerSource:

    PartnerSource

    More Information

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

  • Microsoft Dynamics NAV Team Blog

    Welcome to the Dynamics NAV Team Blog

    • 18 Comments

    Welcome to the Dynamics NAV team blog!! It is critically important for our team to be able to connect with our customers and partners at every opportunity that we can. We are committed to building great products to help you maximize your return on investment with the Dynamics NAV product.

    Sometime last year we passed the 1,000,000 user mark with Dynamics NAV. That is an amazing milestone and we can’t thank you enough for your support of the product and your feedback over the years. Our goal with this blog is to create another place where we can come even closer together as a community, where we can share what we are doing with the product, respond to your questions and concerns, and hopefully pull together around what we believe is our common goal.

    We have been able to get together with some of you at our Convergence Conferences over the years and I cannot describe how much value we have gotten from those experiences. Those countless discussions have resulted in a customer model for your businesses, it has resulted in over 60 personas for different roles in an organization, and it has resulted in one of the core themes of our next release and our role tailored client that we are rolling out across the Dynamics product line. The better we can understand your challenges and dreams the better we can help solve the challenges and make the dreams become a reality.

    Customers and Partners are always at the center of any decisions we make around the direction and functionality of our Product and as we planned for Dynamics NAV 5.0 we also used the customer model very actively, by relating the value of new features to the specific personas. By doing so we find that we as a team are able to more precisely understand and talk about the impact of new features and thereby make them even more relevant to the real users of NAV. Actually since the personas of the customer model all have been given “a name and face”, we today think and talk about our key personas as if they were old familiar members of our team to an extent that we probably wouldn’t be surprised if they one day appeared at our next team meeting in person and just greet them with a, - “Oh, hello Susan, how are you doing today!” (Susan is the name of the Order Processor in the customer model.)

    Today the Dynamics NAV community is incredibly global with over 40 language version and customers in well over 100 countries so far. This diversity provides us tremendous advantages in that we can take our learning from around the world and bring it to the rest of the world. But also means we need to have a deep understanding of what is most important for you to succeed in your local market whether you are a customer using the product, a partner selling and implementing the product, or an ISV building vertical functionality for specific markets.

    I could not be more excited to now be a part of this amazing NAV community. I thought it might be nice to give you some background on the leaders on my team. This way you can connect directly with them and I can show you that we have some very passionate, committed, and experienced people working hard every day to make your investment in Dynamics NAV the best investment you have ever made. This is just the tip of the iceberg and our goal with this blog is to have people from across our team of hundreds of developers, program managers, testers, product managers, user experience experts, content publishing writers, and more to engage with you on this forum.

    Dynamics NAV Leadership

     

    Dynamics NAV Architecture Leadership

     

    We have assembled a leadership team with decades of experience in the software industry, and also decades of experience with the Dynamics NAV product, and we are all committed along with the rest of the fantastic Dynamics NAV team to creating the best possible business solution for all of you.

    Welcome again to the Dynamics NAV team blog, this place will be become better and better if we all use it to share and come together. Thanks in advance for making this a great place to come.

    Darren Laybourn
    General Manager
    Dynamics NAV and Mobility

  • Microsoft Dynamics NAV Team Blog

    Microsoft Dynamics NAV 2013 R2 Now Available

    • 17 Comments

    We are proud to announce that we have shipped Microsoft Dynamics NAV 2013 R2 and that it is now available for download. Yesterday, the announcement was made to the more than 500 partners at the sold-out Directions US event in Nashville, Tennessee. Microsoft Dynamics NAV 2013 R2 adds great new capabilities to the product such as single sign-on with Office 365 and SharePoint Online, a new UI for the Microsoft Dynamics NAV Web client and the Windows client, a new foundation for cash management, a new Help Server, and powerful provisioning and administration tools. Read the announcement on The Edge.

    Best regards,

    The NAV R&D team

  • Microsoft Dynamics NAV Team Blog

    Announcing Microsoft Dynamics NAV 2013 R2 Cumulative Update 1

    • 16 Comments

    We are happy to announce that the Cash Management team has shipped Microsoft Dynamics NAV 2013 R2 Cumulative Update 1. The cumulative update is available for download on PartnerSource/CustomerSource.

    The cumulative update is an application update only. It mainly contains Cash Management features, such as:

    • UI for the Data Exchange Framework
    • Import of SEPA CAMT bank statements in W1 (all countries can use it) and in NL and BE in integration with existing localizations
    • SEPA Direct Debit in FR, IT, ES, BE, and CH in integration with existing localizations

    As a new service, Microsoft Dynamics NAV 2013 R2 Cumulative Update 1 contains the "CU1Help" folder with selected topics for W1 and six country versions that have changed since Microsoft Dynamics NAV 2013 R2. The Help content is in English language only.

    For more information about features in the cumulative update, see What’s New in Microsoft Dynamics 2013 R2 Cumulative Update 1, which is available from the download page or the country-specific What's New topics in the "CU1Help" folder.

    To learn about known issues, of which the first has a prerequisite hotfix, see Release Notes for Microsoft Dynamics 2013 R2 Cumulative Update 1, which is available from the download page.

    To follow installation steps and steps required to use the Data Exchange Framework and to update Help, see How to Update to Microsoft Dynamics 2013 R2 Cumulative Update 1, which is available from the download page. 

    To help customers and partners get an overview of SEPA functionality released in different countries during the calendar year 2013, we have released the “SEPA Functionality in Microsoft Dynamics NAV” white paper on the Getting Ready site for Microsoft Dynamics NAV 2013 R2 on PartnerSource/CustomerSource.

    Note: The product downloads, Help download, and links to supporting documents are presented in a separate section for Microsoft Dynamics NAV 2013 R2 Cumulative Update 1 on the download page on PartnerSource/CustomerSource.

Page 1 of 45 (669 items) 12345»