Microsoft Dynamics NAV

Team Blog

October, 2009

  • Microsoft Dynamics NAV Team Blog

    Creating a web service manually, the importance of the name you give it, and a few small things to remember


    When you use the SC command line command to create a new NAV 2009 Service, how does the new service know whether it is a middle tier for RTC to connect to, or whether it is supposed to handle web service calls?

    In other words, what decides whether the new service will be "Microsoft Dynamics NAV Server" or "Microsoft Dynamics NAV Business Web Services"?


    It depends on the name. If it starts with "MicrosoftDynamicsNavWS", then it will be for Web Services. If the name starts with anything else, then it will be for middle tier for RTC clients.


    To keep things simple, just give your NAV Servers names beginning with MicrosoftDynamicsNAV / MicrosoftDynamicsNAVWS. Then if you need a second, third, etc server, add a unique name, seperated by a $-sign, for example:




    Here are the simple steps for how to create a new web service service, and a few more things to be aware of. Let's say that we want to start a second set of NAV Servers.


    First create the normal service from a command prompt:

    SC CREATE "MicrosoftDynamicsNAV$Svr2" binpath= "C:\Program Files\Microsoft Dynamics NAV\60\Service2\Microsoft.Dynamics.Nav.Server.exe" DisplayName= "MSSvr2"

    Then create the service for Web Services: 

    SC CREATE "MicrosoftDynamicsNAVWS$Svr2" binpath= "C:\Program Files\Microsoft Dynamics NAV\60\Service2\Microsoft.Dynamics.Nav.Server.exe $Svr2" DisplayName= "MSWSSvr2" type= share


    The additional settings you must provide as marked in bold above, and a few things that you must remember are:


    1)  The Name

    As described, the name must begin with MicrosoftDynamicsNAVWS if you want it to be for web services


    2)  Include the last part of the name in BinPath

    After the .exe in the binpath parameter you must specify the part of the name ($Svr2 in this case) that comes after MicrosoftDynamicsNAVWS. If you forget this step, you might get this error when you try to start the service:

    Windows could not start the MSWSSvr2 service on Local Computer.Error 1083: The executable program that this service is configured to run in does not implement the service.


    3)  Type must be share

    For the service that handles web services, add the parameter type= share. Otherwise the service will still try to start up as a middle tier (not for web services).


    4)  Spaces after =

    You must remember the space after each = in the command, as in for example "type= share". This is just the syntax of the SC-command.


    5)  DisplayName

    It doesn't matter what display name you give - this is just to find it in Services.


    These are just some of the small things to keep in mind. For many more details on web services go to Freddys blog, especially this post:

    Multiple Service Tiers - SP1


    // Lars Lohndorf-Larsen


  • Microsoft Dynamics NAV Team Blog

    Send email with PDF attachment in NAV 2009


    In this post I would like to explore the possibilities to create an email from the Role Tailored client and attach an invoice as a PDF file to the email, unfortunately we have do not have this functional build into our Demo application, but let me show you how this can be do with little effort.

    First I suggest you download the fob file which contains the 5 different options I will go through here.

    When downloaded the fob file you will see that I have added 5 new actions


    1. SendAsPDF(Use of codeunit to rename) recommended solution
    2. SendAsPDF(Access to Server needed)
    3. SendAsPDF(With Temp file name)
    4. SendAsPDF(User prompted to save)
    5. SaveAsPDFrecommended solution(if you just want the PDF file)

    Let me go through the different options starting from the bottom, since I recommend option 1, but I would also like to share other options for doing this, since these might be valuable for you.

    Option 5: SaveAsPDF
    In this option you will get prompted if you want to open or save the PDF. The PDF file created will be based on the select Invoice in the Posted Sales Invoices List Place


    In this option all I do is to have the server create the PDF file for me and use the new download function in NAV 2009 to retrieve the PDF file created on the server.

    Option 4: SendAsPDF(User prompted to save)
    In this option, you will first be prompted to save the file.
    Here it is important to select to “”SAVE” the PDF file on the disk, to have the correct name of the PDF file. If you select to “OPEN” the PDF filename will be given a temp name.

    After you have saved the PDF we now create the email message you will get 3 messages similar to this when this happens:


    You get these message because we connect to an external component(Outlook) to the Role Tailored client. It is of course up to you if you want to set this to “Always allow”, but this would remove these messages, the next time you open the Role Tailored client.

    When you have allowed these to run, email will be created with the PDF file attached.


    In this option all I do is to download the PDF to the client and then use the Mail codeunit to create the email

    Option 3: SendAsPDF(With Temp file name)
    In this option, you will not be prompted to save the PDF file.
    And the email will be created immediately. This would probably be the preferred compared to downloading this to the user disk, but we will use the PDF file created on the server, and since this file get a TEMP name, like this: “__TEMP__570eb0279b9d4b1fa837caf3a14acbf7” this option is not really good.

    Let us look at the option 1 and 2 where this issue is solved.

    Option 2: SendAsPDF(Access to Server needed)
    In this option you will not be prompted to save the file either, but here the end user will need to have access the server folder where the PDF is stored on the server. In some situation you might want this, but for security reasons you might also not want to give this access to the user.

    Option 1: SendAsPDF(Use of codeunit to rename) recommended solution
    Again in this option you will not be prompted to save the PDF file, but the PDF file will be automatically added to the email. In this option we have build a codeunit to rename the TEMP file created on the server, and end user will not need to have access to any folders on the server.

    So all in all I recommend option 1 for attaching PDF file to an email. And once again I have made all the code available here, so feel to be explore how I build this. If you feel there is an option that I missed, feel free to leave a commit or use the contact form Email.

    Claus Lundstrøm, Program Manager, Microsoft Dynamics NAV

  • Microsoft Dynamics NAV Team Blog

    “User ID and password are invalid.try again?”


    If you get "User ID and password are invalid.try again?" when starting RTC you need to first check that you can login to database in the classic client. Note that the database should be the same as the service tier (the service you are trying to connect with RTC) is connected to.

    1. Start "classic client with SQL"
    2. Click File->Database->Open
    3. Pick the server the database exist one
    4. Select authentication "Windows Authentication"
    5. Pick the database
    6. Press OK

    If it works in the classic client make database login synchronization.

    1. Start "classic client with SQL" and connect to the database as above
    2. Click Tools->Security->Synchronize all logins
    3. Answer yes to the question if you would like to synchronize

    If it doesn't to connect to the database start SQL server manager and verify that the windows user have permission to login and use the NAV database.

  • Microsoft Dynamics NAV Team Blog

    New Colors, New Design, and Tons of New Content

    It has been about two years since the first post on the Dynamics NAV Team blog. Lots of changes since then! It is high time for a refresh. We hope you like our new design and are able to find topics and posts with ease. The design changes, which are very visible, occurred last week at the same time as some changes to the content and direction of our blog, which might not be so obvious. Here's what is changing:
    • We're focusing our energy on one team blog where you can hear from many different bloggers from all parts of the Dynamics NAV team.
    • We're incorporating lots of NAV blogs from around Microsoft into this one team blog. So far, we've brought in all the posts from the Microsoft Dynamics NAV Sustained Engineering blog and the NAV Developer's blog. You'll soon see a post on these blogs about moving over here to the NAV Team blog. More blogs will be moving soon.
    • We're keeping the original post dates from those blogs and adding tags for the original authors.
    • We organized and refined the tags on all of our blog posts, both the old NAV Team blog posts and the new posts from other NAV blogs.
      • A note about tags - you can set up RSS feeds based on tags. If you want an RSS feed for all posts on the NAV Team blog about Reporting, click the Reporting tag, and then click (RSS) under the Browse by Tags header.
    • With all this new content, we're shifting to being a more technical blog than we were previously. We'll still have announcements, news, and anecdotes now and then, but we'll also feature lots of technical content.
    Our goal is to make it easy for you to find great content from across our whole team and to keep you coming back for more. Let us know what you think!
  • Microsoft Dynamics NAV Team Blog

    What is the "Enable for Microsoft Dynamics NAV Server" option?


    In the Classic client, in either the Alter Database or New Database window, one of the options on the Options tab is Enable for Microsoft Dynamics NAV Server. This option should be selected if you are deploying the RoleTailored client, which communicates with the database through the NAV Server. When this option is selected, access to special properties and .NET code that NAV Server computers must use to access the database is enabled. The option is selected by default; you would clear this option if you knew for sure that all database access would be through classic architecture components such as Classic client and Classic Application Server.


  • Microsoft Dynamics NAV Team Blog

    CREATE DATABASE failed when installing Cronus Sample Database


    Today I did run into a problem installing the “Cronus Sample Database”. In the error report view I found this error message

    SQL Server option

    Cronus Sample Database for Microsoft Dynamics NAV 2009

    Fatal error during installation. 

    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

    After click on the open config link on the error report page I located this key part for the problem

    Configuring MSI package. Id = 'SQLDemoDatabase'

    MSI log file set to: C:\Users\xxxx\AppData\Local\Temp\1\setup.wix.msi.34.log

    Windows Installer: Error: Error -2147217900: failed to execute SQL string, error detail: CREATE DATABASE failed. Some file names listed could not be created. Check related errors., SQL key: CreateDemoDatabase SQL string: CREATE DATABASE [Demo Database NAV (6-0)]

    Done configuring MSI package. ReturnCode = 1603

    In C:\Users\xxxx\AppData\Local\Temp\1\setup.wix.msi.34.log we find this error in the middle of the file

    ExecuteSqlStrings:  Error 0x80040e14: failed to execute SQL string, error: CREATE DATABASE failed. Some file names listed could not be created. Check related errors., SQL key: CreateDemoDatabase SQL string: CREATE DATABASE

    MSI (s) (58!A4) [13:05:11:100]: Product: Microsoft Dynamics NAV 6-0 Database for SQL Server -- Error 26204. Error -2147217900: failed to execute SQL string, error detail: CREATE DATABASE failed. Some file names listed could not be created. Check related errors., SQL key: CreateDemoDatabase SQL string: CREATE DATABASE [Demo Database NAV (6-0)] 

    Error 26204. Error -2147217900: failed to execute SQL string, error detail: CREATE DATABASE failed. Some file names listed could not be created. Check related errors., SQL key: CreateDemoDatabase SQL string: CREATE DATABASE [Demo Database NAV (6-0)]

    The problem here is data files with the same name as the one we are trying to install already exist in the instance. To fix this problem we need to delete those already existing data files. On SQL server 2008 go to C:\Program Files\Microsoft SQL Server\MSSQL10.(instance name)\MSSQL\DATA and delete Demo Database NAV (6-0).mdf and Demo Database NAV (6-0)_log.LDF. After this start main installer again and execute repair.

  • Microsoft Dynamics NAV Team Blog

    Printer Selections in Role Tailored client


    Today Printer Selections Form 64 is not transformed to Printer Selections Page 64 since virtual table 2000000039 is not accessible from Role Tailored client.

    I thought of different options for how we could get page 64 to work and decided to try the new Client Extensibility feature in NAV 2009, although this could also be done with filing a temporary table from COM.

    I would like to share this option with you.

     Page “70809 Printer Selections FactBox” is using a client-addin, based on C#, to read the local installed printers and offers the way to select the name and save it to NAV 2009.

     Page “64 Printer selection” is enhanced with the new fact box.



    You can download the files here:

    You can use the file for your own risk. There is no support for it. 

    (Note: Before you can use the page 70809 you have to install the client extension library “printerslections.dll” on your machine. The easiest way to do this is using the Add-Importer from Christian. )


    Rene - Microsoft Dynamics NAV MVP (

  • Microsoft Dynamics NAV Team Blog

    Doing upgrades to NAV 2009 SP1


    When doing an upgrade - even when not touching the database and application objects - to NAV 2009 SP1, remember to also compile all objects for the new version of executables. Compiling all objects must be done when doing an update from NAV2009 RTM (No SP) to SP1.

    The way objects get compiled for the Role Tailored Client (RTC) has changed between NAV2009 RTM and SP1, and may change again in future versions as part of general improvements. Until you compile all objects in a SP1 Classic Client, opening a NAV 2009 RTM demo database with NAV2009 SP1 RTC will give you a lot of errors saying:

    "Error: Compilation of assembly c:\ etc'"

    And RTC will look like this:


    Of course, if you use a SP1 database or upgrade all objects to SP1, then this will not happen since the objects will already have been compiled for SP1. Compiling objects may also give a few errors even for objects that compiled fine in RTM.

    In a standard demo database at least these two reports in their RTM version will not compile in SP1:

    Report 13 - "VAT Register"
    Report 34 - "Change Payment Tolerance"

    In a localized and/or customized databases there may well be many more objects that won't compile.

    For these specific two reports, either import the SP1 version of the objects. Or correct them manually like this:

    For report 13, the layout has to be re-saved like this:
    Design the report, go to View -> Layout, then save it (Ctrl+S). Exit Visual Studio Report Designer, go back to the classic report design, import the layout, then close and save the report.

    Report 34 has this line that does not compile in SP1:

    Function PageSetCurrency:

        RequestOptionsPage."Max. Pmt. Tolerance Amount".DECIMALPLACESMAX(DecimalPlaces);

    Remove the line that does not compile. Remember to add a semicolon on the line before so that the report will compile.

    Lars Lohndorf-Larsen

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    License for Dynamics NAV 2009 RTC problem


    You do not have permission to run the ‘Microsoft Dynamics NAV Server' system. Contact your system administrator to have your permissions changed

    If you get this error when trying to start the RTC, it normally means it's something wrong with the licenses.
    Ensure that the license you are using has permission to run RTC and service tier (correct granule). Granule needed for RTC:

    • 9,000 Role Centers
    • 9,100 Dynamics NAV Server

    Ensure also that the license is uploaded.

    1. Start classic client
    2. Open the database used by RTC
    3. Click Tools->License information
    4. Click upload and pick the license file to be uploaded to SQL server

    Ensure also that the license is saved in the database.

    1. Start classic client
    2. Open the database used by RTC
    3. Click File->Database->Alter
    4. Click on integration tab
    5. Put a check mark on "Save license in database"
  • Microsoft Dynamics NAV Team Blog

    Using CaptionClass property on a field in a system table can cause problems


    You can experience some problems if you set a value on the ‘CaptionClass’ system tables on NAV 2009 or NAV 2009 SP1. This can also happen if you had already a value on one of the ‘CaptionClass’ system tables on previous versions, and you upgrade to either NAV 2009 or NAV 2009 SP1.

    Problems can appear any time the engine is trying to recompile the system tables, for example, when importing fob files, when re-compiling, or when re-enabling the ‘Enable for Microsoft Dynamics NAV Server’.

    The problem can be prevented if you either: Remove the offending CaptionClass (on the corresponding System Table) or if you Disable the ‘Enable for Microsoft Dynamics NAV Server’ (this will prevent you from using the three tier architecture).

    We have identified this problem and should be solved in the Microsoft Knowledge Base 977121.

  • Microsoft Dynamics NAV Team Blog

    Installation of Dynamics NAV 2009 hangs during installation of Outlook Add-in


    When installing NAV 2009 RTM you can sometimes if you are unlucky end up with an installer that hangs when installing Outlook Add-in. The most common reason for this is that the installation is not able to update the” Outlook.exe.config” file and get stuck in an infinitive loop.
    When looking in the event viewer you will get a similar error message to this:

    Product: Microsoft Dynamics NAV 2009 Outlook Add-in -- Error 27519.Error updating XML file C:\Program Files\Microsoft Office\Office12\Outlook.exe.config. -2147024891

    The problem is that the file is read-only or for some other reason is not accessible. To fix this problem in short words, simple search for “Outlook.exe.config” and make the file not read-only. The “Outlook.exe.config” is hidden, so the easiest way to change the property of the file is to search for it with explorer and under “More advance options” select “Search hidden files and folders”. The installation will directly after you have changed the property continue.

    This problem is fixed in NAV 2009 SP1.

Page 1 of 1 (11 items)