• Microsoft Dynamics NAV Team Blog

    Basic SQL - How to attach a database to SQL Server

    • 0 Comments

    This post is part of "Overview of NAV-specific SQL features for application consultants".

    If you receive a SQL Server database file (.MDF), then you must attach this to your SQL Server before you can access it. This is how to do that:

    1)     Copy the Database file (.MDF), for example “Demo Database NAV (6-0)_Data.MDF” into the folder where SQL Server keeps the database files. On SQL Server 2008 this defaults to “C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA”:

    CopyDBFile

    2)     Open SQL Server Management Studio. Note: On Windows Vista / Windows 2008, you must open it as Administrator to have the right permissions. Otherwise the next steps might fail, and maybe without giving you any error messages:

    OpenAsAdmin

    3)     In SQL Server Management Studio right click on Databases, select Attach... click Add, then select the file you copied in step 1, then click OK:

    AddDB

    4)     The database file may be pointing to a transaction log which you don’t have and don’t need. So, before clicking OK again, check if there is a reference to the transaction log under “Database Details”. Remove it if there is, and then click OK:

    RemoveTransactionLog

    5)     If you receive any warnings about adding catalogues, then ignore those. As long as you now see the new database in SQL Server Management Studio:

    DatabaseAttached

    You should now be able to open the database with a NAV client. Note, the SQL backup will contain any user IDs and permissions that were created in the database, so you would need to know what login to use. In the case of Windows logins, of course if the database came from another system / another domain, then any Windows logins will not be valid on your domain.

     

     

    Lars Lohndorf-Larsen (Lohndorf )

    Microsoft Dynamics UK

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Building a Role Center in 1 hour

    • 0 Comments

    First I want to say thanks to people who attended Michael Rosenørn and My session, about building a Role Center in 1 hour, at Convergence 2008 last week in Denmark. Our evaluation score for this session was second highest out of all sessions at Convergence, so we must have done something right :-) Thanks guys!!!

    Still I a have a feeling that there are so much more I would like to share with you on how we build up the Role Center, so I have decided to share our demo script for this session.

    To the readers which did not attend the session. Michael acted as the Customer and I as the Partner and Live implementer at stage.

    The story: Michael (The customers) is requesting Me(The Partner) to implement a Role Center for his Election Manager user profile. The Election Manager is responsible for following up on sponsor for the upcoming election. We are imaging that there is a big election coming up even though we all know this just finished in the US.
    So the Election Manager need to keep track of the sponsors in his portfolio. Which sponsor has delivered what they have promised? And which sponsor have not delivered? Election manager will need to get a fast overview of which Sponsor he need to follow up on.
    Also the Election Manager needs to setup events and would like to see who is responsible for each of these events. So with this background we start building the Role Center.
    Credit goes to Andy Blehm, our Developer Lead on the Client team, for coming up with this story. Thanks Andy.

    You can find the demo script attached to this post. In this zip file you will find the following files:

    1. Election - Demo Script.docx(This is the actual Demo Script, no proofreading so if there is any spelling mistake please just blame me)
    2. Election Demo Data.txt(Demo Data to import before demo)
    3. Election Objects START.fob(Prepared Objects. These are prepared to keep the demo in 1 hour, many of the prepared demo objects are explained during the demo)
    4. Election Objects START.txt(and in txt format as well if you prefer this)
    5. Election Objects END.fob(All objects included the objects build during the demo. If you just want to see what we build and don't care about the demo script, this is your file )
    6. Election Objects END.txt (and in txt format as well if you prefer this)

    Regards,
    Claus Lundstrøm

  • Microsoft Dynamics NAV Team Blog

    Tip 3: Using Exchange Public Folders and Outlook synchronization in Dynamics NAV 5.0, 5.0 SP1 and 2009

    • 0 Comments

    Many people ask if it is possible to use Public Folders for data storage in regards to the redesigned Outlook Synchronization in releases after Dynamics NAV 4.0 taking into account that there are no conditions or filters set for the contacts entities. The answer is simple: yes, you can! There is one big pitfall. In scenarios where there are thousands of contacts to be synchronized, Exchange Server tend to think that this is not OK. There are some KB published on that topic:
    http://support.microsoft.com/kb/830836
    http://support.microsoft.com/kb/830829/

    There are some more KB articles in regards to event ID 9646, but the two KB articles are more then enough in regards to the blog posting.

    The question I usually ask partners and customer is why they want all the Dynamic related contacts to be synchronized to each and every salesperson? Can you imagine how large these mailbox will become and what that means for the underlying network in Cached Exchange Mode and in non Cached Exchange mode. The answer is in most cases, we did not assign our contacts to a specific salesperson. If those partners or customers try to synchronize the whole Dynamics NAV contacts database to Outlook, then nothing synchronizes! Sometimes partners and customers answers that table 13 is filled with regional codes in stead of real salespersoncodes, like EU1 (Northern European Countries), EU2 (Southern European Countries), etc.  

    In this scenario, one may want to create three Public Folders for the three Contact entities without any condition and configure the Outlook Addin with the three Public Folders. In this scenario, one would still need a dedicated user account plus mailbox so that the Outlook Addin can be configured. Very easy, just create a mailbox enabled user on the Active Directory computer, configure that user in the Login table of Dynamics NAV with the necessary Roles, then configure the new user with at least the two Contact entities (Company contacts and Person contacts), registry that in the change log and you are done.

    In the scenario of separating Scandinavian contacts from Italian contacts and so on, one could create two mailbox enabled users and one could configure those two users with the two contacts entities with a condition defined for each part of Europe. To summarize, this scenario would end up with two user account that are only being used for the Outlook Synchronization and at least four Public Folders.

    Always remember that Tasks and Appointment must be somehow linked to a "salesperson". This is quite logical, because there must be a meeting Organizer and an Owner of the Tasks.

    -- mmels

  • Microsoft Dynamics NAV Team Blog

    Basic SQL - How to create a new NAV database for restoring a NAV backup

    • 2 Comments

    This post is part of "Overview of NAV-specific SQL features for application consultants". 

     

    This post describes the steps needed to create a new NAV database from a NAV backup (.fbk) file. All the steps are done from a NAV client:

    1)     Start a NAV client (finsql.exe), then go to File -> Database -> New. In Server Name, enter (local)  - assuming you have SQL Server on the same machine. Then click OK.


    2)    You only have to enter a database name, and click OK. But if the database is used for test purposes, I would also recommend you change “Recovery Model” from Full to Simple (Options tab), and change “Security Model” from Enhanced to Standard (Advanced tab). Then click OK.


    3)    Now you have a blank NAV database. All you have to do, is to restore your NAV backup (.fbk) file: Tools -> Restore.


    4)    If you want to change the NAV license, then go to Tools -> License Information, and click Upload, and select the NAV license. This uploads the license to the SQL Server, and it will be stored there for the next time you start NAV.

     

     

    Lars Lohndorf-Larsen (Lohndorf)

    Microsoft Dynamics UK


    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Basic SQL - Enable trace flag 4616 on SQL Server

    • 0 Comments

    This post is part of "Overview of NAV-specific SQL features for application consultants".

     

    The newest versions of Microsoft Dynamics NAV require trace flag 4616 to be enabled on SQL Server. If not, then you will get this error message when you try to connect:


    ===
    The trace flag 4616 is not set on the server (local). You must set this flag and restart the server before you can connect using Microsoft Dynamics NAV.

    ===

    Error4616

    How to set trace flag 4616:


    Start SQL Server Configuration Manager:
    Start -> All Programs -> Microsoft SQL Server 2005/8 -> Configuration Tools -> SQL Server Configuration Manager
    On the left side, select “SQL Server Services”, then Locate” SQL Server (MSSQLSERVER)” on the right side. Right click it and select Properties. Then select the Advanced tab:

    SQLConfigManager

    Then add the startup parameter at the end of the existing ones (separating the existing ones with a semi-colon):
    ;-t4616


    Then click OK.
    You must restart the SQL Server service before this setting takes effect: Right click on “SQL Server (MSSQLSERVER)” again, and this time select Restart.

     

     


    Lars Lohndorf-Larsen (Lohndorf)

    Microsoft Dynamics UK


    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Basic SQL - Creating Extended Stored Procedure / xp_ndo.dll

    • 0 Comments

    This post is part of "Overview of NAV-specific SQL features for application consultants". 

     

    Microsoft Dynamics NAV requires two extended stored procedures from xp_ndo.dll to exist on SQL Server if Windows logins are used. If these extended stored procedures do not exist, you will get this error when trying to log on using Windows Authentication:

    ---
    The extended stored procedure xp_ndo_enumusersids in the library file xp_ndo.dll, is not available on the LOHNDORF1 server.  Until this procedure and library have been added, it will not be possible to connect to this server from Microsoft Dynamics NAV with Windows Authentication, but you will still be able to connect with Database Server Authentication.  You can read more about adding this extended stored procedure in the help pages on the product CD. Follow the hyperlink to the readme.txt file on the Servers page under the Documentation section of SQL Server.

    ---

    XP_Ndo

    When this happens you have two options: Use Database Authentication instead, or create the extended stored procedures on the SQL Server. a normal installation of a NAV client will create these procedures automatically, which is why in most cases you don’t need to do it. But if for some reason it was not created, then this is how to do it manually:

    1)    From the product DVD, open the folder sql_esp, and run the file xp_ndo.exe to extract the file xp_ndo.dll somewhere you your disk. Then copy it into this folder on your SQL Server (on SQL 2008): C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\. Remember, copying files into the “Program Files”-folder requires administrative privileges on Vista and Windows2008, which is why you should extract the file to a different folder first, and then copy it into this location.


    2)     Open SQL Server Management Studio. Extend Databases -> System Databases -> master -> Programmability. Right click on “Extended stored procedures”, and select “New extended stored procedure”.


    3)    Name it xp_ndo_enumusersids, and in the DLL field, select the full file and path for xp_ndo.dll (on SQL Server 2008 C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\xp_ndo.dll):

    CreateXP_Ndo

    4)     Assign permissions to the public role: In the Extended Stored Procedures properties, click on “Permissions”, then “Search”. Type in “Public”, and click OK. Then assign Execute permissions to Public:

    AssignPermissions

    5)     Finally, repeat the previous steps and make another extended stored procedure which is exactly identical, except this one must be called xp_ndo_enumusergroups instead of xp_ndo_enumusersids.

    You should now have two extended stored procedures, and should be able to use Windows login from NAV.

     

     

    Lars Lohndorf-Larsen (Lohndorf)

    Microsoft Dynamics UK


    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Basic SQL - Installing SQL Server 2005 / 2008

    • 0 Comments

    This post is part of "Overview of NAV-specific SQL features for application consultants".

    It describes the simplest way to get SQL Server installed in a test environment. It only mentions the changes to the default installation options that you need to make to get SQL Server running for NAV. Needless to say that for installing SQL Server in a live environment, there are further considerations to make like security, performance, etc, which are not described here.

    Which edition:

    If you have a choice of editions, then for a test system choose Developer Edition unless you have specific reasons to chose something else.

    Installation options:

    The following options are for installing SQL Server 2008, but the same options exist when installing SQL Server 2005, even though the menus may look slightly different.


    The minimum features that you need to install are:
      “Database Engine Services”
      “Management Tools”
    But I would also recommend installing “SQL Server Books Online”:

    InstallOptions

    Another decision you have to make, is which account the SQL Server Services run under. When prompted for this, for a test system, set all SQL Server Services to use the “NT Authority\SYSTEM” account (just specify the account, and leave password blank). When installing SQL Server 2008 it looks like this – for SQL Server 2005 it looks slightly different:

    SelectAccounts

    The final place where you should deviate from the default installation options, is to set Authentication Mode to “Mixed Mode”. As default, SQL Server will only use Windows Authentication. Setting it to “Mixed Mode” also gives you a database login, which can be useful in some cases:

    MixedMode


    Remember the password you specify here! This password is for the sa account, so you will always be able to log in to SQL Server as System Administrator with user ID "sa" and the password you decide here.

    Use default options for the rest of the installation.

    Once you have installed SQL Server, then you will find “SQL Server Management Studio” in the start menu, which is where you can do all the admin tasks that you need.

     

     

    Lars Lohndorf-Larsen (Lohndorf )

    Microsoft Dynamics UK

  • Microsoft Dynamics NAV Team Blog

    Basic SQL - Overview of NAV specific SQL features for application consultants

    • 0 Comments

    As the title says, this post is not really for NAV developers, but for application consultants who don't use SQL Server every day but still need to know enough about SQL Server to at least get a Microsoft Dynamics NAV database to run on it.

    The challenge is, that even a basic SQL course or book will cover material which is 85% unrelated to NAV, and cover SQL features which you may never use when you only need to run NAV on a SQL server in a test environment. So the point of this post is to explain the basic steps needed to get NAV up and running on SQL Server (2005 / 2008) in the simplest and shortest way possible.

     

    I will assume that the instructions here will only be used to get NAV to run in a test environment, and not cover any features like security and performance which should be considered for a live system. Also, I will only explain the minimum steps needed to get NAV to run - not any background of why this or that needs to be done.

    This post contains a very general overview, and then links to a number of seperate posts for each individual area. So you can use this for an overview / table of content, and then link to the specific topic that you need.

    These are the areas planned for now - more may follow:

    1. Instaling SQL Server
    2. Create stored procedure from xp_ndo.dll for Windows authentication
    3. Enable trace flag 4616
    4. Create a NAV database
    5. Attach a NAV database
    6. Restore a SQL backup of a NAV database
    7. Creating users on SQL Server for use in NAV

    All the posts are tagged "Basic SQL", so you can list them from here.

    1.  Installing SQL Server

    When installing a NAV client you have the option to install the SQL Server engine as well, and the installation will automatically attach a NAV database ready to use. As long as this works for you you don't have to install SQL Server as well. But if something needs changing or troubleshooting, or if you need to attach a different SQL database, then you need the admin tool (SQL Server Management Studio), which is when you need to install SQL Server.

    The installation is fairly straigthforward. You should just change two of the default options:

    •   Set all SQL Server services to use the System account, and
    •   change the authentication mode from "Windows Authentication" to "Mixed Mode"

    For further details, go to this post:

      Installing SQL Server

     

    2.  Create stored procedure from xp_ndo.dll for Windows authentication

    NAV requires two extended stored procedures called xp_ndo_enumusergroups and xp_ndo_enumusersids, both based on xp_ndo.dll (can be found in the sql_esp folder on the product DVD). If these extended stored procedures are not present, and you try to log in with Windows Authentication, you will get this error message:

    ====
    The extended stored procedure xp_ndo_enumusersids in the library file xp_ndo.dll, is not available on the LOHNDORF1 server.  Until this procedure and library have been added, it will not be possible to connect to this server from Microsoft Dynamics NAV with Windows Authentication, but you will still be able to connect with Database Server Authentication.  You can read more about adding this extended stored procedure in the help pages on the product CD. Follow the hyperlink to the readme.txt file on the Servers page under the Documentation section of SQL Server.
    ====

    For details on how to create these two extended stored procedures, follow this post:

    Creating extended stored procedures in xp_ndo.dll

     

    3.  Enable trace flag 4616

    Since NAV version 4 Sp3 the NAV client requires this trace flag to be enabled on SQL Server. If it's not, then you will get this error when trying to connect to a SQL database from NAV:

    ====
    The trace flag 4616 is not set on the server (local). You must set this flag and restart the server before you can connect using Microsoft Dynamics NAV.

    ====

    Enable the trace flag by adding ;-t4616 to the end of startup parameters, and then restarting the SQL Server service. For furhter details how to do this, follow this post:

    Enabling trace flag 4616

     

    4.  How to create a NAV database

    Creating a new database on SQL Server is almost identical to creating a new database on native: File -> Database -> New, then enter name etc. And, from there restore a NAV backup (.fbk file). More details - if needed - here:

    Creating a NAV database from a NAV backup (.fbk file)

     

    5.  Attach a SQL database

    Attaching a SQL database is done entirely from the SQL Server environment (SQL Server Management Studio). It's not often you would need to do this. But for example if you want to attach the demo database from the product DVD, then this is how to do that:

    Attaching a SQL database

     

    6.  Restore a SQL backup of a NAV database

    With NAV on SQL Server you can either use the native backup or SQL Server backups. If a backup was done with SQL Server, you also need SQL Server to restore it. SQL Server backups are generally quicker than a NAV backup, but also often larger. Your SQL Server backup strtegy can be as complex as you like, but restoring a singe, complete backup is quite simple:

    Restoring a SQL backup of a NAV database

     

    7.  Creating users on SQL Server for use in NAV

    When setting up a user for NAV, this user first has to exist on SQL Server. So you have to create the user under Security -> Logins in SQL Server Management Studio before creating them in NAV:

    Creating users on SQL Server for use in NAV

     

     

     

    Lars Lohndorf-Larsen (Lohndorf)

    Microsoft Dynamics UK


    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Tip 2: Fixing language issues when trying to setup the Outlook Synchronization in Dynamics NAV 5.0, Dynamics NAV 5.0 SP1 and Dynamics NAV 2009

    • 0 Comments

    If you are working in a localized release of Dynamics NAV with the redesigned Outlook Synchronization, I bet that you were dealing with a
    language issue. Perhaps you forgot to set the Regional Options for the NAS user account, perhaps you did not follow the Localization Tips
    of the Installation & Setup Whitepaper. Who does not know about the famous page 55 of that guide, please get familiar with this guide
    and download your copy of it today:
    Installation & Setup Whitepaper

    When you are running Dynamics NAV 5.0 SP1 or Dynamics NAV 2009 that will be released later this year, then this guide also applies as well.
    Everything that is written in this guide, applies to later releases of Dynamics NAV. Only NST (Navision Service Tier) and RTC (Role Tailored
    Client) is new and is not part of that Installation & Setup Whitepaper.

    If you start up a localized release of Dynamics NAV, it might well be that the language has been set to ENU. If you do not pay attention to
    that and click on Outlook Synch User Setup or Outlook Synch. Entities, then it might well be that the entities are configured for ENU
    language. Later on, after getting errors in the Outlook Addin, you would think about it and you change it. At that point, you will have
    mixed entities and the Outlook Synchronization will never occur without errors.

    Let me show you a screenshot of a small issue that can cause much troubles though the actual ToDo's are synchronized to Outlook:

    image 

    In another blog I already discussed how to fix this issue. Here is an extract of that blog:

    <snip>

    As per this writing, this bug also exists in all local releases of Dynamics NAV 2009 CTP4 release:
    - select Administration / Application Setup / Microsoft Office Outlook Integration / Outlook Synch. Entities
    - press F5 and select APP and press OK
    - under Outlook Collection, we see Recipients and a local value for Links (in Dutch release it is called Koppelingen)
    - select the local value for Links and press F6
    - manually select Links and press OK
    - press F5 and select TASK and press OK
    - under Outlook Collection, we see Recipients and a local value for Links (in Dutch release it is called Koppelingen)
    - select the local value for Links and press F6
    - manually select Links and press OK
    6. now enable the Marco Mels user with the 5 demo entities via Administration / Application Setup / Microsoft Office Outlook
    Integration / Outlook Synch. User Setup

    <snip>

    Now, let's assume you have started the wrong way and the you configured the Outlook Synch. User Setup with entities for a specific user
    "while the language of the CSIDE Client was set to English".

    image
    In ENU language this is Microsoft Dynamics NAV - Meetings, but in localized release, Meetings is translated to local value!

    There is an easy way to fix this, though it is a bit of work. You will have to clear everything out of the Outlook Synch. User Setup and you
    will have to reset all entities to default. E.g.:
     

    image

    After changing language and after clearing everything from the Outlook Synch. User Setup, the description will change to a local description.
    This will have to be done this in order of CONT_SP, CONT_COMP, CONT_PERS, TASK and finally APP. Of course, in the next screen you must
    select the correct choice:"

    image 

    After this has been done, you need to add the user and configure the required entities, the number of Elements, the conditions, etc. At the
    end, register the changes in the Change Log via:

    image

    Now the Outlook Synchronization has been correctly setup for any localized release of the CSIDE Client.

     

    --  mmels

  • Microsoft Dynamics NAV Team Blog

    Tip 1: The related item for the synchronized Outlook item is not found in the specified folders. The following values were expected

    • 0 Comments

    When working with the Outlook Synchronization using Dynamics NAV 5.0, Dynamics NAV 5.0 SP1 and Dynamics NAV 2009 (present release: CTP4)
    in an Exchange Server environment, the following very annoying error may show up in the Outlook Addin.

    The related item for the synchronized Outlook item is not found in the specified folders. The following values were expected: /o=CRONUS/
    ou=First Administrative Group/cn=Recipients/cn=marcomels

    The Installation and Setup guide that was compiled for the Partnersource Update gives information about this error on page 41. Here is an extract of that paper:

    <snip>

    When working in Microsoft Exchange environment make sure that the e-mail for the salesperson is defined in Outlook, and not in Microsoft Dynamics NAV. In this
    case, the e-mail will be converted into Exchange format, for example c=us;a= ;p=Cronus;o=Exchange;s=Hill;g=Annette;i=ah.

    · When a contact being synchronized is registered in Microsoft Exchange environment, make sure that the e-mail for this contact is defined in Outlook, and
    not in Microsoft Dynamics NAV. In this case, the e-mail will be converted into Exchange format and the synchronization will work properly.

    · The name and e-mail of the to-do organizer must be filled in and be identical to the name and e-mail of the current Outlook user in order for the to-do
    to be synchronized correctly
    .

    · Choose related contacts and recipients for appointments or tasks exclusively from the folders defined in the synchronization setup

    When creating an appointment or task, choose related contacts and recipients from the folders defined in the synchronization setup. If contacts
    and recipients were selected from other folders, these appointments and tasks will not be synchronized.

    <snip>
    This issue can be easily reproduced in the following scenario:
    1. Windows 2003 or later hosting Active Directory and Exchange 200x Server or later hosting a mailbox enabled user called "Marco Mels"
    2. Windows 2003 or later hosting SQL 2005 or later
    3. Windows XP or Windows Vista hosting Outlook 2003 or later and hosting Dynamics NAV client 5.0 + Outlook Addin 25874 and later releases of
    Dynamics NAV and hosting the Dynamics NAV 5.0 NAS
    To exclude possible permissions error we may run against to, we assign the following roles / permissions to the Marco Mels user:
    1. AD: Domain Admin / Administrator Group
    2. Client: Local Administrator / SUPER user role in Dynamics NAV
    Steps to be taken in Dynamics NAV to finish the scenario:
    1. Synch permissions to SQL
    2. follow localization steps that are written on page 50 of the Installation and Setup guide (alligning system and license files)
    3. enable Change Log Activated via Administration / Application Setup / General / Change Log Setup
    4. if using a localized release of NAV, make sure the language matches the system text files and license files via Tools (menu) / Language, select localized language
    and press OK
    5. fix a small bug that exists in all releases of Dynamics NAV including the 25874 build and the Dynamics NAV 5.0 SP1 build.
    As per this writing, this bug also exists in all local releases of Dynamics NAV 2009 CTP4 release:
    - select Administration / Application Setup / Microsoft Office Outlook Integration / Outlook Synch. Entities
    - press F5 and select APP and press OK
    - under Outlook Collection, we see Recipients and a local value for Links (in Dutch release it is called Koppelingen)
    - select the local value for Links and press F6
    - manually select Links and press OK
    - press F5 and select TASK and press OK
    - under Outlook Collection, we see Recipients and a local value for Links (in Dutch release it is called Koppelingen)
    - select the local value for Links and press F6
    - manually select Links and press OK
    6. now enable the Marco Mels user with the 5 demo entities via Administration / Application Setup / Microsoft Office Outlook Integration / Outlook
    Synch. User Setup

    Outlook Synch User SetupJPG

    Setting conditions is not mandatory but should be done to prevent mass data transfer to a local mailbox or a Public Folder:

    NOTE: if large data is being send to either a mailbox or a public folder in an Exchange environment, an error can occur referring you to the log file which is
    or is not enabled by the adminisrator. It can well be that Exchange is being triggered by a limitation. To workaround that issue, please do see the following
    KB article:
    830829 Your Exchange Server 2003 computer may stop responding after a MAPI client opens more than the default value of certain server objects
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;830829
    7. start up Outlook, create the Outlook profile, create 5 new folders dedicated for the 5 entites and configure the Outlook Addin
    8. perform a Full Synchronization

    Result:
    A new contact item is created for the salesperson
    9. start up Dynamics NAV client and create a simple ToDo of type Meeting and a simple ToDo of type Phone Call for salesperson Marco Mels
    10. using Outlook, perform a synchronization
    Result:
    A new task is being created and a new meeting is being created
    An error occured in the Outlook Addin Troubleshooting window:

    The related item for the synchronized Outlook item is not found in the specified folders. The following values were expected: /o=CRONUS/ou=First
    Administrative Group/cn=Recipients/cn=marcomels

    The reason for this error is that in table 13 Salesperson/Purchaser, the field E-mail 2 is fileld with marcomels@cronus.com. The Outlook Addin however
    expected the following value: /o=CRONUS/ou=First Administrative Group/cn=Recipients/cn=marcomels

    To work around this issue, please do the following:
    From Outlook, open the contact entry and update the E-mail address with the correct values: marcomels@cronus.com. Synchronize back to Dynamics NAV.
    After you have configured the other entities and after you have done the same tests again with the two ToDo's, you sometimes see that the error still occurs.
    The reason for this is that you did not actually select the correct mailbox user out of the Exchange Global Address list.

    To correctly update the E-mail address in Outlook so that E-mail 2 can be filled with the correct values, you will have to do the following. After you have
    synchronized the salesperson to Outlook, open the contact entry in Outlook. Press the E-mail... button next to the E-mail address field and select the correct
    user from the Exchange Global Address List. Save the contact entry and perform a synchronization. Table 13 will now contain two different entries for the
    E-mail and E-mail 2 fields:

    table13

    Now, if you synchronize the two ToDo's, the results will be that the Task and Meetings are created without any further error messages.

    -- mmels

  • Microsoft Dynamics NAV Team Blog

    3D charts. Chart Generator tool II

    • 1 Comments

    One of the new features in NAV 2009 is the new chart (KPI) object, described in more details here:

    NAV 2009 - How to generate charts / KPIs

    This post describes how to make 3D rotatable charts, and includes an update to the Chart Generator Tool which makes is simple to make your own 3D charts.

    For basics about how to make charts, please refer to the post linked above. To add the 3rd dimension to your charts, all you need to do is to add a Z-axis. This gives you charts that can look like this:

    Item stacks by location:

     ItemStacksbyLocation

     

    Customer balance by discount group:

    CustBalanceByDiscGroup

     

    A chart automatically becomes a 3D chart by adding a Z-axis to the chart definition, for example like this:

    - <ZAxis ShowTitle="false">

    <Field Name="Customer Disc. Group" />

    </ZAxis>

    And the presence of a Z-axis will automatically make the user able to rotate the chart.

    Below, you can find the following:

    1. Chart definition for the two charts pictured above, so you can import them into your own CROUS database
    2. Chart Generator Tool, updated so that it can handle Z-axis, so you can create your own charts.

    Lars Lohndorf-Larsen (Lohndorf )
    Microsoft Dynamics UK
    Microsoft Customer Service and Support (CSS) EMEA

     

    Chart definitions

     

    Item stacks by location:

    - <ChartDefinition xmlns="urn:schemas-microsoft-com:dynamics:NAV:MetaObjects" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Type="Column">

    - <Title>

    <Text ID="ENU">Items by location</Text>

    </Title>

    - <Table ID="32">

    - <Filters>

    - <Filter>

    <Field Name="Item No." />

    <Value>70000|70001|70002|70003</Value>

    </Filter>

    </Filters>

    </Table>

    - <XAxis ShowTitle="true">

    - <Title>

    <Text ID="ENU">Location Code</Text>

    </Title>

    <Field Name="Location Code" />

    </XAxis>

    - <ZAxis ShowTitle="false">

    <Field Name="Item No." />

    </ZAxis>

    - <YAxis ShowTitle="false">

    - <Measures>

    - <Measure Operator="Sum">

    <Field Name="Quantity" />

    </Measure>

    </Measures>

    </YAxis>

    </ChartDefinition>

     

     

    Customer balance by discount group:

    - <ChartDefinition xmlns="urn:schemas-microsoft-com:dynamics:NAV:MetaObjects" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Type="Column">

    - <Title>

    <Text ID="ENU">Customer Balance</Text>

    </Title>

    - <Table ID="18">

    <Filters />

    </Table>

    - <XAxis ShowTitle="true">

    - <Title>

    <Text ID="ENU">No.</Text>

    </Title>

    <Field Name="No." />

    </XAxis>

    - <ZAxis ShowTitle="false">

    <Field Name="Customer Disc. Group" />

    </ZAxis>

    - <YAxis ShowTitle="false">

    - <Measures>

    - <Measure Operator="Sum">

    <Field Name="Balance (LCY)" />

    </Measure>

    </Measures>

    </YAxis>

    </ChartDefinition>

     

    Chart Generator Tool II

    This is an improvement to the Chart Generator tool from this post. This version adds the possibility to set a Z-axis, and in this way make 3D charts.

     

    To use it, save the code below to a text file. Then remove all [RemoveMe] from the text after checking that the object types and IDs won't replace existing objects that you want to keep. Then import it into NAV from Object Designer, and compile.

     

    for instructions of how to use the tool, follow the link above to the original post.

     

    OBJECT Table [RemoveMe]72000 Chart Generator
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        OnInsert=BEGIN
                   IF Chart.GET(Company,ID) THEN
                     ERROR('Chart already exists in table 2000000078. Run form 9182 and delete it, or use a different ID.');
                 END;

        LookupFormID=Form72000;
      }
      FIELDS
      {
        { 1   ;   ;Company             ;Text30         }
        { 2   ;   ;ID                  ;Code20        ;NotBlank=Yes }
        { 10  ;   ;Name                ;Text50        ;OnValidate=BEGIN
                                                                    Title := Name;
                                                                  END;
                                                                   }
        { 11  ;   ;Title               ;Text50         }
        { 15  ;   ;Type                ;Option        ;OptionString=Column,Point }
        { 16  ;   ;Table ID            ;Integer       ;OnValidate=BEGIN
                                                                    MODIFY;
                                                                  END;
                                                                   }
        { 17  ;   ;Table Name          ;Text30        ;FieldClass=FlowField;
                                                       CalcFormula=Lookup(Object.Name WHERE (Type=CONST(Table),
                                                                                             ID=FIELD(Table ID)));
                                                       Editable=No }
        { 20  ;   ;XAxis Field ID      ;Integer        }
        { 21  ;   ;XAxis Field Name    ;Text80        ;OnValidate=BEGIN
                                                                    IF "XAxis Field Name" <> '' THEN BEGIN
                                                                      FieldRec.SETRANGE(TableNo,"Table ID");
                                                                      FieldRec.SETRANGE(FieldName,"XAxis Field Name");
                                                                      FieldRec.FINDFIRST;
                                                                      "XAxis Field ID" := FieldRec."No.";
                                                                      "XAxis Field Name" := FieldRec.FieldName;
                                                                      "XAxis Field Caption" := FieldRec."Field Caption";
                                                                      "XAxis title" := FieldRec."Field Caption";
                                                                    END ELSE BEGIN
                                                                      "XAxis Field ID" := 0;
                                                                      "XAxis Field Name" := '';
                                                                      "XAxis Field Caption" := '';
                                                                      "XAxis title" := '';
                                                                    END;
                                                                  END;
                                                                   }
        { 22  ;   ;XAxis Field Caption ;Text80         }
        { 23  ;   ;XAxis title         ;Text80         }
        { 24  ;   ;XAxis Show Title    ;Boolean       ;InitValue=Yes }
        { 30  ;   ;YAxis fields        ;Integer       ;FieldClass=FlowField;
                                                       CalcFormula=Count("Chart Generator YAxis" WHERE (Company=FIELD(Company),
                                                                                                        ID=FIELD(ID)));
                                                       Editable=No }
        { 35  ;   ;ZAxis Field Name    ;Text80        ;OnValidate=BEGIN
                                                                    IF "ZAxis Field Name" <> '' THEN BEGIN
                                                                      FieldRec.SETRANGE(TableNo,"Table ID");
                                                                      FieldRec.SETRANGE(FieldName,"ZAxis Field Name");
                                                                      FieldRec.FINDFIRST;
                                                                    END;
                                                                  END;
                                                                   }
        { 38  ;   ;ZAxis Show Title    ;Boolean        }
      }
      KEYS
      {
        {    ;Company,ID                              ;Clustered=Yes }
      }
      FIELDGROUPS
      {
      }
      CODE
      {
        VAR
          Chart@1000 : Record 2000000078;
          FieldRec@1102601000 : Record 2000000041;

        BEGIN
        END.
      }
    }

    OBJECT Table [RemoveMe]72001 Chart Generator Filter
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        OnInsert=BEGIN
                   TESTFIELD("Filter Field ID");
                 END;

      }
      FIELDS
      {
        { 1   ;   ;Company             ;Text30         }
        { 2   ;   ;ID                  ;Code20         }
        { 3   ;   ;Line No.            ;Integer        }
        { 10  ;   ;Filter Field ID     ;Integer       ;OnValidate=BEGIN
                                                                    IF "Filter Field ID" <> 0 THEN BEGIN
                                                                       ChartGen.GET(Company,ID);
                                                                       ChartGen.TESTFIELD("Table ID");
                                                                       FieldRec.GET(ChartGen."Table ID","Filter Field ID");
                                                                       "Filter Field Name" := FieldRec.FieldName;
                                                                    END ELSE
                                                                       "Filter Field Name" := '';
                                                                  END;
                                                                   }
        { 11  ;   ;Filter Field Name   ;Text30         }
        { 15  ;   ;Filter Value        ;Text30         }
      }
      KEYS
      {
        {    ;Company,ID,Line No.                     ;Clustered=Yes }
      }
      FIELDGROUPS
      {
      }
      CODE
      {
        VAR
          ChartGen@1102601001 : Record 72000;
          FieldRec@1102601000 : Record 2000000041;

        BEGIN
        END.
      }
    }

    OBJECT Table [RemoveMe]72003 Chart Generator YAxis
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        OnInsert=BEGIN
                   TESTFIELD("YAxis Measure Field ID");
                 END;

        LookupFormID=Form72003;
        DrillDownFormID=Form72003;
      }
      FIELDS
      {
        { 1   ;   ;Company             ;Text30         }
        { 2   ;   ;ID                  ;Code20         }
        { 3   ;   ;Line No.            ;Integer        }
        { 10  ;   ;YAxis Measure Field ID;Integer      }
        { 11  ;   ;YAxis Measure Field Caption;Text30  }
        { 12  ;   ;Mearure Operator    ;Option        ;OptionString=Sum,Count }
        { 20  ;   ;Show Title          ;Boolean        }
      }
      KEYS
      {
        {    ;Company,ID,Line No.                     ;Clustered=Yes }
      }
      FIELDGROUPS
      {
      }
      CODE
      {

        BEGIN
        END.
      }
    }

    OBJECT Form [RemoveMe]72000 Chart Generator List
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        Width=16500;
        Height=6710;
        TableBoxID=1;
        SourceTable=Table72000;
      }
      CONTROLS
      {
        { 1   ;TableBox     ;220  ;220  ;16060;5500 ;HorzGlue=Both;
                                                     VertGlue=Both }
        { 2   ;TextBox      ;0    ;0    ;4400 ;0    ;HorzGlue=Both;
                                                     Visible=No;
                                                     ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=Company }
        { 3   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=2;
                                                     InColumnHeading=Yes }
        { 4   ;TextBox      ;0    ;0    ;1700 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=ID }
        { 5   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=4;
                                                     InColumnHeading=Yes }
        { 6   ;TextBox      ;0    ;0    ;4400 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=Name }
        { 7   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=6;
                                                     InColumnHeading=Yes }
        { 8   ;TextBox      ;0    ;0    ;4400 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=Title }
        { 9   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=8;
                                                     InColumnHeading=Yes }
        { 10  ;TextBox      ;0    ;0    ;550  ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=Type }
        { 11  ;Label        ;0    ;0    ;0    ;0    ;ParentControl=10;
                                                     InColumnHeading=Yes }
        { 12  ;TextBox      ;0    ;0    ;1700 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="Table ID" }
        { 13  ;Label        ;0    ;0    ;0    ;0    ;ParentControl=12;
                                                     InColumnHeading=Yes }
        { 14  ;CommandButton;4400 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     Default=Yes;
                                                     PushAction=LookupOK;
                                                     InvalidActionAppearance=Hide }
        { 15  ;CommandButton;6820 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     Cancel=Yes;
                                                     PushAction=LookupCancel;
                                                     InvalidActionAppearance=Hide }
        { 16  ;CommandButton;14080;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     PushAction=FormHelp }
        { 17  ;MenuButton   ;9240 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     CaptionML=ENU=Chart;
                                                     Menu=MENUITEMS
                                                     {
                                                       { ID=18;
                                                         PushAction=RunObject;
                                                         CaptionML=ENU=Filters;
                                                         RunObject=Form 72001;
                                                         RunFormLink=Company=FIELD(Company),
                                                                     ID=FIELD(ID) }
                                                       { ID=20;
                                                         PushAction=RunObject;
                                                         CaptionML=ENU=XAxis;
                                                         RunObject=Form 72002;
                                                         RunFormLink=Field1=FIELD(Company),
                                                                     Field2=FIELD(ID) }
                                                       { ID=21;
                                                         PushAction=RunObject;
                                                         CaptionML=ENU=YAxis;
                                                         RunObject=Form 72003;
                                                         RunFormLink=Company=FIELD(Company),
                                                                     ID=FIELD(ID) }
                                                     }
                                                      }
        { 19  ;MenuButton   ;11660;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     CaptionML=ENU=F&unctions;
                                                     Menu=MENUITEMS
                                                     {
                                                       { ID=22;
                                                         PushAction=RunObject;
                                                         ShortCutKey=F11;
                                                         CaptionML=ENU=Generate Chart;
                                                         RunObject=Codeunit 72000 }
                                                     }
                                                      }
      }
      CODE
      {
        VAR
          Chart@1000 : Record 2000000078;

        BEGIN
        END.
      }
    }

    OBJECT Form [RemoveMe]72001 Chart Filters
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        Width=12150;
        Height=6710;
        TableBoxID=1;
        SourceTable=Table72001;
        AutoSplitKey=Yes;
        DelayedInsert=Yes;
      }
      CONTROLS
      {
        { 1   ;TableBox     ;220  ;220  ;11710;5500 ;HorzGlue=Both;
                                                     VertGlue=Both }
        { 2   ;TextBox      ;0    ;0    ;1700 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="Filter Field ID";
                                                     OnLookup=BEGIN
                                                                ChartGen.GET(Company,ID);
                                                                ChartGen.TESTFIELD("Table ID");
                                                                FieldRec.SETRANGE(TableNo,ChartGen."Table ID");

                                                                IF FORM.RUNMODAL(FORM::"Field List",FieldRec) = ACTION::LookupOK

    THEN
                                                                  VALIDATE("Filter Field ID",FieldRec."No.");
                                                              END;
                                                               }
        { 3   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=2;
                                                     InColumnHeading=Yes }
        { 4   ;TextBox      ;0    ;0    ;4400 ;0    ;HorzGlue=Both;
                                                     ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="Filter Field Name" }
        { 5   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=4;
                                                     InColumnHeading=Yes }
        { 6   ;TextBox      ;0    ;0    ;4400 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="Filter Value" }
        { 7   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=6;
                                                     InColumnHeading=Yes }
        { 8   ;CommandButton;4890 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     Default=Yes;
                                                     PushAction=LookupOK;
                                                     InvalidActionAppearance=Hide }
        { 9   ;CommandButton;7310 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     Cancel=Yes;
                                                     PushAction=LookupCancel;
                                                     InvalidActionAppearance=Hide }
        { 10  ;CommandButton;9730 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     PushAction=FormHelp }
      }
      CODE
      {
        VAR
          ChartGen@1000 : Record 72000;
          FieldRec@1001 : Record 2000000041;

        BEGIN
        END.
      }
    }

    OBJECT Form [RemoveMe]72003 YAxis List
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        Width=10000;
        Height=6710;
        TableBoxID=1;
        SourceTable=Table72003;
        AutoSplitKey=Yes;
        DelayedInsert=Yes;
      }
      CONTROLS
      {
        { 1   ;TableBox     ;220  ;220  ;9560 ;5500 ;HorzGlue=Both;
                                                     VertGlue=Both }
        { 2   ;TextBox      ;0    ;0    ;1700 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="YAxis Measure Field ID";
                                                     OnLookup=BEGIN
                                                                ChartGen.GET(Company,ID);
                                                                ChartGen.TESTFIELD("Table ID");
                                                                FieldRec.SETRANGE(TableNo,ChartGen."Table ID");

                                                                IF FORM.RUNMODAL(FORM::"Field List",FieldRec) = ACTION::LookupOK

    THEN BEGIN
                                                                  "YAxis Measure Field ID" := FieldRec."No.";
                                                                  "YAxis Measure Field Caption" := FieldRec."Field Caption";
                                                                END;
                                                              END;
                                                               }
        { 3   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=2;
                                                     InColumnHeading=Yes }
        { 4   ;TextBox      ;0    ;0    ;4400 ;0    ;HorzGlue=Both;
                                                     ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="YAxis Measure Field Caption" }
        { 5   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=4;
                                                     InColumnHeading=Yes }
        { 6   ;TextBox      ;0    ;0    ;550  ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr="Mearure Operator" }
        { 7   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=6;
                                                     InColumnHeading=Yes }
        { 8   ;CheckBox     ;0    ;0    ;1700 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     ShowCaption=No;
                                                     SourceExpr="Show Title" }
        { 9   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=8;
                                                     InColumnHeading=Yes }
        { 10  ;CommandButton;2740 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     Default=Yes;
                                                     PushAction=LookupOK;
                                                     InvalidActionAppearance=Hide }
        { 11  ;CommandButton;5160 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     Cancel=Yes;
                                                     PushAction=LookupCancel;
                                                     InvalidActionAppearance=Hide }
        { 12  ;CommandButton;7580 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     PushAction=FormHelp }
      }
      CODE
      {
        VAR
          ChartGen@1000 : Record 72000;
          FieldRec@1001 : Record 2000000041;

        BEGIN
        END.
      }
    }

    OBJECT Form [RemoveMe]72004 Chart Generator Card
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        Width=16170;
        Height=6490;
        SourceTable=Table72000;
      }
      CONTROLS
      {
        { 1   ;TabControl   ;220  ;220  ;15730;5280 ;HorzGlue=Both;
                                                     VertGlue=Both;
                                                     PageNamesML=ENU=General }
        { 4   ;TextBox      ;3850 ;990  ;2750 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr=ID }
        { 5   ;Label        ;440  ;990  ;3300 ;440  ;ParentControl=4 }
        { 6   ;TextBox      ;3850 ;1650 ;5500 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     NextControl=12;
                                                     SourceExpr=Name }
        { 7   ;Label        ;440  ;1650 ;3300 ;440  ;ParentControl=6 }
        { 8   ;TextBox      ;3850 ;2200 ;5500 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr=Title }
        { 9   ;Label        ;440  ;2200 ;3300 ;440  ;ParentControl=8 }
        { 10  ;TextBox      ;3850 ;3520 ;2750 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr=Type }
        { 11  ;Label        ;440  ;3520 ;3300 ;440  ;ParentControl=10 }
        { 12  ;TextBox      ;3850 ;2860 ;1700 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr="Table ID";
                                                     OnLookup=BEGIN
                                                                Object.SETRANGE(Type,Object.Type::Table);
                                                                IF FORM.RUNMODAL(FORM::Objects,Object) = ACTION::LookupOK THEN
                                                                  "Table ID" := Object.ID;
                                                              END;

                                                     OnAfterValidate=BEGIN
                                                                       CALCFIELDS("Table Name");
                                                                     END;
                                                                      }
        { 13  ;Label        ;440  ;2860 ;3300 ;440  ;ParentControl=12 }
        { 21  ;TextBox      ;12980;990  ;2750 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     NextControl=1102601000;
                                                     SourceExpr="XAxis Field Name";
                                                     OnLookup=BEGIN
                                                                TESTFIELD("Table ID");
                                                                FieldRec.SETRANGE(TableNo,"Table ID");

                                                                IF FORM.RUNMODAL(FORM::"Field List",FieldRec) = ACTION::LookupOK

    THEN
                                                                  VALIDATE("XAxis Field Name",FieldRec.FieldName);
                                                              END;
                                                               }
        { 22  ;Label        ;9570 ;990  ;3300 ;440  ;ParentControl=21 }
        { 20  ;TextBox      ;12980;1650 ;2750 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr="XAxis Field Caption" }
        { 23  ;Label        ;9570 ;1650 ;3300 ;440  ;ParentControl=20 }
        { 24  ;CheckBox     ;12980;2750 ;440  ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     ShowCaption=No;
                                                     SourceExpr="XAxis Show Title" }
        { 25  ;Label        ;9570 ;2750 ;3300 ;440  ;ParentControl=24 }
        { 27  ;TextBox      ;12980;2200 ;2750 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr="XAxis title" }
        { 28  ;Label        ;9570 ;2200 ;3300 ;440  ;ParentControl=27 }
        { 1102601000;TextBox;12980;3410 ;1700 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr="YAxis fields" }
        { 1102601001;Label  ;9570 ;3410 ;3300 ;440  ;ParentControl=1102601000 }
        { 1102601002;TextBox;5720 ;2860 ;3630 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr="Table Name" }
        { 1102601003;TextBox;12980;4070 ;2750 ;440  ;ParentControl=1;
                                                     InPage=0;
                                                     SourceExpr="ZAxis Field Name";
                                                     OnLookup=BEGIN
                                                                TESTFIELD("Table ID");
                                                                FieldRec.SETRANGE(TableNo,"Table ID");

                                                                IF FORM.RUNMODAL(FORM::"Field List",FieldRec) = ACTION::LookupOK

    THEN
                                                                  VALIDATE("ZAxis Field Name",FieldRec.FieldName);
                                                              END;
                                                               }
        { 1102601004;Label  ;9570 ;4070 ;3300 ;440  ;ParentControl=1102601003 }
        { 14  ;CommandButton;13750;5720 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     PushAction=FormHelp }
        { 15  ;MenuButton   ;11330;5720 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     CaptionML=ENU=&Chart;
                                                     Menu=MENUITEMS
                                                     {
                                                       { ID=16;
                                                         PushAction=LookupTable;
                                                         ShortCutKey=F5;
                                                         CaptionML=ENU=L&ist }
                                                       { ID=26;
                                                         PushAction=RunObject;
                                                         CaptionML=ENU=Filters;
                                                         RunObject=Form 72001;
                                                         RunFormLink=Company=FIELD(Company),
                                                                     ID=FIELD(ID) }
                                                       { ID=17;
                                                         PushAction=RunObject;
                                                         CaptionML=ENU=YAxis;
                                                         RunObject=Form 72003;
                                                         RunFormLink=Company=FIELD(Company),
                                                                     ID=FIELD(ID) }
                                                       { ID=18;
                                                         MenuItemType=Separator }
                                                       { ID=19;
                                                         PushAction=RunObject;
                                                         ShortCutKey=F11;
                                                         CaptionML=ENU=Generate Chart;
                                                         RunObject=Codeunit 72000 }
                                                     }
                                                      }
      }
      CODE
      {
        VAR
          FieldRec@1001 : Record 2000000041;
          Object@1002 : Record 2000000001;
          XAxisField@1000 : Text[30];

        BEGIN
        END.
      }
    }

    OBJECT Codeunit [RemoveMe]72000 Chart Generator Mgt
    {
      OBJECT-PROPERTIES
      {
        Date=17/10/08;
        Time=12:00:00;
        Version List=CGT;
      }
      PROPERTIES
      {
        TableNo=72000;
        OnRun=BEGIN
                CreateXML(Rec);

                MESSAGE('Chart %1 was created / updated.',Chart.ID);
              END;

      }
      CODE
      {
        VAR
          Chart@1015 : Record 2000000078;
          ChartGen@1003 : Record 72000;
          ChartFilters@1008 : Record 72001;
          ChartYAxis@1012 : Record 72003;
          "3TierMgt"@1013 : Codeunit 419;
          XMLDoc@1000 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{F6D90F11-9C73-11D3-B32E-00C04F990BB4}:'Microsoft

    XML, v4.0'.DOMDocument";
          DomNode@1001 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{2933BF80-7B36-11D2-B20E-

    00C04F983E60}:'Microsoft XML, v4.0'.IXMLDOMNode";
          DomNode2@1006 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{2933BF80-7B36-11D2-B20E-

    00C04F983E60}:'Microsoft XML, v4.0'.IXMLDOMNode";
          DomTextNode@1002 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{2933BF87-7B36-11D2-B20E-

    00C04F983E60}:'Microsoft XML, v4.0'.IXMLDOMText";
          DomAttribute@1004 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{2933BF85-7B36-11D2-B20E-

    00C04F983E60}:'Microsoft XML, v4.0'.IXMLDOMAttribute";
          DomNodeList@1009 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{2933BF82-7B36-11D2-B20E-

    00C04F983E60}:'Microsoft XML, v4.0'.IXMLDOMNodeList";
          DomProcessInstruction@1005 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{2933BF89-7B36-11D2-B20E-

    00C04F983E60}:'Microsoft XML, v4.0'.IXMLDOMProcessingInstruction";
          NameSpace@1007 : Text[80];
          i@1010 : Integer;
          TempFileName@1014 : Text[250];
          Debug@1016 : Boolean;
          DebugFileName@1102601000 : Text[250];
          IStream@1102601001 : InStream;

        PROCEDURE CreateXML@1(ChartGenerator@1000 : Record 72000);
        BEGIN
          //=== Enable debug and filename to save the xml document to disk
          Debug := FALSE;
          DebugFileName := '';
          //===

          CREATE(XMLDoc);
          XMLDoc.async(FALSE);

          // Initialize document and set namespaces
          NameSpace := 'urn:schemas-microsoft-com:dynamics:NAV:MetaObjects';

          DomNode := XMLDoc.createNode(1,'ChartDefinition',NameSpace);
          DomAttribute := XMLDoc.createAttribute('xmlns:xsd');
          DomAttribute.value := 'http://www.w3.org/2001/XMLSchema';
          DomNode.attributes.setNamedItem(DomAttribute);
          DomAttribute := XMLDoc.createAttribute('xmlns:xsi');
          DomAttribute.value := 'http://www.w3.org/2001/XMLSchema-instance';
          DomNode.attributes.setNamedItem(DomAttribute);

          // add chart type
          DomAttribute := XMLDoc.createAttribute('Type');
          CASE ChartGenerator.Type OF
            ChartGenerator.Type::Column:
              DomAttribute.value := 'Column';
            ChartGenerator.Type::Point:
              DomAttribute.value := 'Point';
          END;
          DomNode.attributes.setNamedItem(DomAttribute);
          XMLDoc.appendChild(DomNode);

          AddNode('ChartDefinition','Title','');
          AddNode('ChartDefinition/Title','Text',ChartGenerator.Title);
          AddAttribute('ChartDefinition/Title/Text','ID','ENU');
          AddNode('ChartDefinition','Table','');
          AddAttribute('ChartDefinition/Table','ID',FORMAT(ChartGenerator."Table ID"));
          AddNode('ChartDefinition/Table','Filters','');

          // Filters
          ChartFilters.SETRANGE(Company,ChartGenerator.Company);
          ChartFilters.SETRANGE(ID,ChartGenerator.ID);
          IF ChartFilters.FINDSET THEN
            REPEAT
              AddNode('ChartDefinition/Table/Filters','Filter','');
              AddNode('ChartDefinition/Table/Filters/Filter','Field','');
              AddAttribute('ChartDefinition/Table/Filters/Filter/Field','Name',ChartFilters."Filter Field Name");
              AddNode('ChartDefinition/Table/Filters/Filter','Value',ChartFilters."Filter Value");
            UNTIL ChartFilters.NEXT = 0;

          // XAxis
          ChartGenerator.TESTFIELD("XAxis Field Name");

          AddNode('ChartDefinition','XAxis','');
          AddAttribute('ChartDefinition/XAxis','ShowTitle',BooleanFormat(ChartGenerator."XAxis Show Title")); ///
          AddNode('ChartDefinition/XAxis','Title','');
          AddNode('ChartDefinition/XAxis/Title','Text',ChartGenerator."XAxis title");
          AddAttribute('ChartDefinition/XAxis/Title/Text','ID','ENU');
          AddNode('ChartDefinition/XAxis','Field','');
          AddAttribute('ChartDefinition/XAxis/Field','Name',ChartGenerator."XAxis Field Name");

          // ZAxis///
          IF ChartGenerator."ZAxis Field Name" <> '' THEN BEGIN
            AddNode('ChartDefinition','ZAxis','');
            AddAttribute('ChartDefinition/ZAxis','ShowTitle',BooleanFormat(ChartGenerator."ZAxis Show Title"));
            AddNode('ChartDefinition/ZAxis','Field','');
            AddAttribute('ChartDefinition/ZAxis/Field','Name',ChartGenerator."ZAxis Field Name");
          END;

          // YAxis
          ChartYAxis.SETRANGE(Company,ChartGenerator.Company);
          ChartYAxis.SETRANGE(ID,ChartGenerator.ID);
          IF ChartYAxis.FINDSET THEN BEGIN
            AddNode('ChartDefinition','YAxis','');
            AddAttribute('ChartDefinition/YAxis','ShowTitle',BooleanFormat(ChartYAxis."Show Title"));
            AddNode('ChartDefinition/YAxis','Measures','');

            REPEAT
              AddNode('ChartDefinition/YAxis/Measures','Measure','');
              AddAttribute('ChartDefinition/YAxis/Measures/Measure','Operator',FORMAT(ChartYAxis."Mearure Operator"));
              AddNode('ChartDefinition/YAxis/Measures/Measure','Field','');
              AddAttribute('ChartDefinition/YAxis/Measures/Measure/Field','Name',FORMAT(ChartYAxis."YAxis Measure Field

    Caption"));
            UNTIL ChartYAxis.NEXT = 0;
          END;

          TempFileName := TEMPORARYPATH + '\' + FORMAT(CREATEGUID) + '.xml';

          XMLDoc.save(TempFileName);

          IF NOT Chart.GET(ChartGenerator.Company,ChartGenerator.ID) THEN BEGIN
            Chart.Company := ChartGenerator.Company;
            Chart.ID := ChartGenerator.ID;
            Chart.Name := ChartGenerator.Name;
            Chart.INSERT;
          END;
          Chart.BLOB.IMPORT(TempFileName);
          Chart.MODIFY;

          IF Debug THEN
            XMLDoc.save(DebugFileName);

          // Clean up
          IF EXISTS(TempFileName) THEN
            ERASE(TempFileName);
          CLEAR(DomNode);
          CLEAR(XMLDoc);
        END;

        PROCEDURE AddNode@2(AddToNode@1000 : Text[120];NodeName@1001 : Text[120];NodeValue@1002 : Text[120]);
        BEGIN
          DomNodeList := XMLDoc.selectNodes(AddToNode);
          DomNode := DomNodeList.item(DomNodeList.length - 1);

          DomNode2 := XMLDoc.createNode(1,NodeName,NameSpace);
          DomTextNode := XMLDoc.createTextNode(NodeValue);
          DomNode2.appendChild(DomTextNode);
          DomNode.appendChild(DomNode2);
        END;

        PROCEDURE AddAttribute@3(AddToNode@1000 : Text[120];AttributeName@1001 : Text[120];AttributeValue@1002 : Text[120]);
        BEGIN
          DomNodeList := XMLDoc.selectNodes(AddToNode);
          DomNode := DomNodeList.item(DomNodeList.length - 1);

          DomAttribute := XMLDoc.createAttribute(AttributeName);
          DomAttribute.value := AttributeValue;
          DomNode.attributes.setNamedItem(DomAttribute);
        END;

        PROCEDURE BooleanFormat@4(Boo@1000 : Boolean) : Text[30];
        BEGIN
          IF Boo THEN
            EXIT('true');

          EXIT('false');
        END;

        EVENT XMLDoc@1000::ondataavailable@198();
        BEGIN
        END;

        EVENT XMLDoc@1000::onreadystatechange@-609();
        BEGIN
        END;

        BEGIN
        END.
      }
    }

     

     

  • Microsoft Dynamics NAV Team Blog

    Error - Cannot create more than one clustered index on table

    • 0 Comments

    This post describes one scenario in which this error occurs. There may be others.

    In the late 4.0 versions of the NAV executables, all tables in NAV had a clustered index created on SQL for the primary key (Index 0).
    However, the table objects in 4.0 versions did not have the Clustered property set on any of the keys.
    It was also possible on 4.0 to toggle that property (on/off) and NAV would allow you to leave the table with none of the keys flagged as clustered, but the primary index on SQL remained clustered.

    In the 5.0 versions, this behavior has changed. It is no longer possible to modify a table object to turn off the Clustered property on all keys. If you do this, save and compile the table, and then go back into designer and view keys, you will see that the 5.0 (and SP1) client has automatically turned on the Clustered property on the primary key. It is not possible in 5.0 to create a table with no clustered index.

     So, consider a scenario where you have a 4.0 database that has been converted to 5.0 SP1 executables. This is usually done one of two ways...

    1) Open the 4.0 database with the 5.0 SP1 executable and click Ok to convert
    2) Create a new database with the 5.0 SP1 executable and restore the 4.0 database backup using the NAV Client.

    With 5.0 SP1, using either of these two methods, the Clustered property on the 4.0 object's primary key is automatically flagged.

    If for any reason a 4.0 table object is later imported into the converted database, you end up with a situation where the clustered index remains on SQL, but the table object no longer has the Clustered property flagged. This doesn't cause any immediate problem, but let's say you later want to do a full object upgrade to 5.0 SP1 objects. In step 8 of the Upgrade Quickguide, you are instructed to import the new customized objects created in the compare and merge process. Some of the 5.0 SP1 table objects, for example Sales Header, have had the clustered index changed to a secondary key. When these tables are imported into the database, NAV will not drop the primary clustered index but will try to create the secondary clustered index, triggering the above error.

    The workaround for this issue is to go into the table object in design mode and flag the primary key as clustered, then try importing the 5.0 SP1 table object again. Because the Clustered property is set, NAV will drop and recreate the primary key (index on SQL) before creating the secondary clustered index.


    Laura K. Lake (lalake)

    Microsoft Dynamics NA


    Microsoft Customer Service and Support (CSS) North America

  • Microsoft Dynamics NAV Team Blog

    RIM Tool on 5.0 SP1

    • 0 Comments

    Although the RIM tool was originally designed to assist in the setup of Master data; i.e. Customers, Vendors, Items, etc., the reality is that many are using the Data Migration tool to bring in journal lines to set up beginning balances and to bring over historical data from legacy applications.

    With the release of 5.0 SP1, a new data type conversion routine was introduced with codeunit 5302 - Outlook Synch. Type Conversion. There are several known issues with data conversion due to these changes.

    All of these issue have been reported to development and are being considered for a fix in a future release of the NAV product.

    This post offers some code suggestions and workarounds for the more common and/or critical issues. Many of the suggested workarounds involve one particular codeunit in the Data Migration tool, 8611 – Migration Management, so the following combined change log should be helpful.


    This change log applies to 5.0 SP1 application objects ONLY.

    Issues addressed by the change log:

    1) Overflow on type conversion from Text to Text in Form 8626 when a text field larger than 100 chars is imported.
    2) Error on import of fields beginning with a number (i.e. 1099 Code) - The call to member selectSingleNode failed. msxml6.dll returned the following message: Expression must evaluate to a node-set.
    3) Imported dates are blank after migration data is applied.
    4) Decimal values are converted incorrectly. Ex. - 7,500 becomes 7.5 after the migration data is applied.
    5) Negative decimal values are converted incorrectly, resulting in changed values.
    6) Error - Expected token 'EOF' found '$'. Error on fields with $ symbol
    7) Error - The expression Text cannot be type-converted to a Boolean value (or Date value). This may occur on Setup Questionnaire, Data Migration or Data Template.


    Changes are labeled with the associated number above.


    *****Start Code fix*****

     

    Form 8626 Migration Records

    ---------------------------

    Before:

    CODE

      {

        VAR

          MatrixColumnCaptions@1000 : ARRAY [100] OF Text[100];

          MigrationData@1001 : Record 8615;

          MatrixCellData@1002 : ARRAY [100] OF Text[100];

          MigrationColumnField@1004 : ARRAY [100] OF Integer;

          MatrixColumnOrdinal@1003 : Integer;

          FormCaption@1005 : Text[1024];

          TableNo@1006 : Integer;

          Text001@1007 : TextConst 'ENU=%1 value ''%2'' does not exist.';

    After:

    CODE

      {

        VAR

          MatrixColumnCaptions@1000 : ARRAY [100] OF Text[100];

          MigrationData@1001 : Record 8615;

          MatrixCellData@1002 : ARRAY [100] OF Text[250];  // #1 Change Text[100] to Text[250]

          MigrationColumnField@1004 : ARRAY [100] OF Integer;

          MatrixColumnOrdinal@1003 : Integer;

          FormCaption@1005 : Text[1024];

          TableNo@1006 : Integer;

          Text001@1007 : TextConst 'ENU=%1 value ''%2'' does not exist.';

     

    * XMLport 8610 - Setup DataSchema

    ---------------------------------

    ...

    NameIn := DELCHR(NameIn,'=','Ù''`');

    NameIn := DELCHR(CONVERTSTR(NameIn,'<>,./\+-&()%','            '),'=',' ');

    NameIn := DELCHR(NameIn,'=',' ');

    EXIT(NameIn);

    ...

     

    After:

    ...

    NameIn := DELCHR(NameIn,'=','Ù''`');

    NameIn := DELCHR(CONVERTSTR(NameIn,'<>,./\+-&()%$','             '),'=',' ');  // #6 Change line- add $ symbol

    NameIn := DELCHR(NameIn,'=',' ');

    IF (NameIn[1] >= '0') AND (NameIn[1] <= '9') THEN    // #2 Add line

      NameIn := '_' + NameIn;         // #2 Add line

    EXIT(NameIn);

     

    * Codeunit 8611\Function FieldNodeExists ...

    --------------------------------------------

    Before:

    FieldNode := RecordNode.selectSingleNode(FieldNodeName);

    IF NOT ISCLEAR(FieldNode) THEN

      EXIT(TRUE);

    After:

    IF (FieldNodeName[1] >= '0') AND (FieldNodeName[1] <= '9') THEN         //  #2 Add line

      FieldNodeName := '_' + FieldNodeName;                                                   //  #2 Add line

    FieldNode := RecordNode.selectSingleNode(FieldNodeName);

    IF NOT ISCLEAR(FieldNode) THEN

      EXIT(TRUE);

     

    * Codeunit 8611, Function GetElementName

    ----------------------------------------

    Before:

    ...

    NameIn := DELCHR(NameIn,'=','Ù''`');

    NameIn := DELCHR(CONVERTSTR(NameIn,'<>,./\+-&()%','            '),'=',' ');

    NameIn := DELCHR(NameIn,'=',' ');

    EXIT(NameIn);

    ...

     

    After:

    ...

    NameIn := DELCHR(NameIn,'=','Ù''`');

    NameIn := DELCHR(CONVERTSTR(NameIn,'<>,./\+-&()%$','             '),'=',' ');  // #6 Change line - add $ symbol

    NameIn := DELCHR(NameIn,'=',' ');

    IF (NameIn[1] >= '0') AND (NameIn[1] <= '9') THEN    // #2 Add line

      NameIn := '_' + NameIn;     // #2 Add line

    EXIT(NameIn);

    * Codeunit 8611, Function ValidateFieldValue

    --------------------------------------------

    Before:

     

    Field.GET(RecRef.NUMBER,FieldRef.NUMBER);

    IF Field.Type <> Field.Type::Option THEN BEGIN

      IF Value <> '' THEN

        //IF CompanySetupRun THEN                                           // #7 Delete

          EVALUATE(FieldRef,Value)

        //ELSE                                                                               // #7 Delete

        //  FieldRef.VALIDATE(Value);                                         // #7 Delete

    END ELSE

      IF GetOption(Value,FieldRef.OPTIONCAPTION,OptionAsInteger) THEN

        IF CompanySetupRun THEN

          FieldRef.VALUE := OptionAsInteger

        ELSE

          FieldRef.VALIDATE(OptionAsInteger);

    IF NOT CompanySetupRun THEN

      IF NOT TestRelation(FieldRef) THEN

        FieldRef.VALIDATE;

    After:

     

    Field.GET(RecRef.NUMBER,FieldRef.NUMBER);

    IF Field.Type <> Field.Type::Option THEN BEGIN

      IF Value <> '' THEN

          EVALUATE(FieldRef,Value)

    END ELSE

      IF GetOption(Value,FieldRef.OPTIONCAPTION,OptionAsInteger) THEN

        IF CompanySetupRun THEN

          FieldRef.VALUE := OptionAsInteger

        ELSE

          FieldRef.VALIDATE(OptionAsInteger);

    IF NOT CompanySetupRun THEN

      IF NOT TestRelation(FieldRef) THEN

        FieldRef.VALIDATE;

    * Codeunit 8611, Function ModifyRecordWithOtherFields

    -----------------------------------------------------

    Before:

    VAR

          MatrixData@1002 : Record 8615;

          MigrationTableField@1000 : Record 8616;

          Question@1003 : Record 8612;

          Field@1007 : Record 2000000041;

          MigrationTable@1009 : Record 8613;

          DataTemplateHeader@1011 : Record 8618;

          QuestionnaireMgt@1006 : Codeunit 8610;

          TemplateMgt@1012 : Codeunit 8612;

          OSynchTypeConversion@1014 : Codeunit 5302;

          FieldRef@1001 : FieldRef;

          OptionInt@1008 : Integer;

          DateFormula@1010 : DateFormula;

          ToValidate@1013 : Boolean;

    After:

     VAR

          MatrixData@1002 : Record 8615;

          MigrationTableField@1000 : Record 8616;

          Question@1003 : Record 8612;

          Field@1007 : Record 2000000041;

          MigrationTable@1009 : Record 8613;

          DataTemplateHeader@1011 : Record 8618;

          QuestionnaireMgt@1006 : Codeunit 8610;

          TemplateMgt@1012 : Codeunit 8612;

          OSynchTypeConversion@1014 : Codeunit 5302;

          FieldRef@1001 : FieldRef;

          OptionInt@1008 : Integer;

          DateFormula@1010 : DateFormula;

          ToValidate@1013 : Boolean;

          DateValue@1500000 : Date;                   // #3 Add

    Before:

     

        IF MigrationTableField.FIND('-') THEN

          IF NOT IsKeyField(MigrationTableField.TableID,MigrationTableField.FieldID) THEN BEGIN

            FieldRef := RecRef.FIELD(MatrixData.FieldID);

            IF CompanySetupRun THEN

              ToValidate:= FALSE

            ELSE

              ToValidate := MigrationTableField.Validate AND NOT TestRelation(FieldRef);

            OSynchTypeConversion.EvaluateTextToFieldRef(MatrixData.Value,FieldRef,ToValidate)

          END;

          IF DataTemplateHeader.GET(MigrationTable."Data Template") THEN

            TemplateMgt.UpdateRecord(DataTemplateHeader,RecRef);

    After:

        IF MigrationTableField.FIND('-') THEN

          IF NOT IsKeyField(MigrationTableField.TableID,MigrationTableField.FieldID) THEN BEGIN

            FieldRef := RecRef.FIELD(MatrixData.FieldID);

            IF CompanySetupRun THEN

              ToValidate:= FALSE

            ELSE

              ToValidate := MigrationTableField.Validate AND NOT TestRelation(FieldRef);

            //OSynchTypeConversion.EvaluateTextToFieldRef(MatrixData.Value,FieldRef,ToValidate)          // #3 Delete

            Field.GET(RecRef.NUMBER, FieldRef.NUMBER);       // #3 Add line

            IF Field.Type <> Field.Type::Date THEN                 // #3 Add line

              OSynchTypeConversion.EvaluateTextToFieldRef(MatrixData.Value,FieldRef,ToValidate)      // #3 Add line

            ELSE BEGIN                     // #3 Add line

              EVALUATE(DateValue, MatrixData.Value);          // #3 Add line

              FieldRef.VALUE := DateValue;      // #3 Add line

            END;         // #3 Add line

          END;

          IF DataTemplateHeader.GET(MigrationTable."Data Template") THEN

            TemplateMgt.UpdateRecord(DataTemplateHeader,RecRef);

     

    * Codeunit 8611, Function ImportSetupDataXML

    --------------------------------------------

    Before:

     

                IF MigrationData.Value <> '' THEN BEGIN

                  ConvertXMLDates(FieldRef,MigrationData.Value);

                  FieldError(MigrationData,EvaluateValue(FieldRef,MigrationData.Value));

                  IF FORMAT(FieldRef.VALUE) <> '' THEN

                    IF FORMAT(FieldRef.TYPE) <> 'Option' THEN

                      MigrationData.Value := FORMAT(FieldRef.VALUE)

                    ELSE

                      MigrationData.Value := GetOptionString(FieldRef,FORMAT(FieldRef.VALUE));

    After:

                IF MigrationData.Value <> '' THEN BEGIN

                  ConvertXMLDates(FieldRef,MigrationData.Value);

                  FieldError(MigrationData,EvaluateValue(FieldRef,MigrationData.Value));

                  IF FORMAT(FieldRef.VALUE) <> '' THEN

                    IF FORMAT(FieldRef.TYPE) <> 'Option' THEN BEGIN                                    // #4 Add BEGIN

                      IF FORMAT(FieldRef.TYPE) <> 'Decimal' THEN                                       // #4 Add line

                        MigrationData.Value := FORMAT(FieldRef.VALUE);

                    END ELSE                                                                           // #4 Add END

                      MigrationData.Value := GetOptionString(FieldRef,FORMAT(FieldRef.VALUE));           

     

    * Codeunit 8611, Function ConvertXMLDates

    -----------------------------------------

    Before:

     

         CASE Field.Type OF

        

           Field.Type::Date:

             BEGIN

               IF EVALUATE(Date, Value,XMLFormat) THEN BEGIN

                 Value := FORMAT(Date);

                 FldRef.VALUE := Date;

               END;

             END;

     

    After:

     

          CASE Field.Type OF

            Field.Type::Decimal:                                             // # 4 Add line

              BEGIN                                                              // # 4 Add line

                IF EVALUATE(Decimal,Value) THEN BEGIN      // # 4 Add line

                  Value := FORMAT(Decimal,0,XMLFormat);     // # 4 Add line

     

                  FldRef.VALUE := Decimal;                           // # 4 Add line

                END;                                                           // # 4 Add line

              END;                                                             // # 4 Add line

            Field.Type::Date:

              BEGIN

                IF EVALUATE(Date, Value,XMLFormat) THEN BEGIN

                  Value := FORMAT(Date);

                  FldRef.VALUE := Date;

                END;

              END;

     

    * Codeunit 5302, Function TextToDecimal

    ----------------------------------------

    Before:

     

    InputText := CONVERTSTR(InputText,'.',',');

    IF STRPOS(InputText,',') = 0 THEN

      EXIT;

    PartArray[1] := GetSubStrByNo(1,InputText);

                                                                                

    After:

    InputText := CONVERTSTR(InputText,'.',',');

    IF STRPOS(InputText,',') = 0 THEN BEGIN                         // # 4 Add BEGIN

      IsConverted := TextToInteger(InputText,IntegeralPart);       // # 4 Add line

      IF IsConverted THEN                                                      // # 4 Add line

        DecVar := IntegeralPart;                                              // # 4 Add line

      EXIT;

    END;                                                                            // # Add END

    PartArray[1] := GetSubStrByNo(1,InputText);

     

    Before:

     

    DecVar := IntegeralPart + (FractionalPart / POWER(10,STRLEN(PartArray[2])));    

     

    After:

     

    IF STRPOS(InputText,'-') = 0 THEN  // # 5 Add line

      Sign := 1       // # 5 Add line

    ELSE        // # 5 Add line

      Sign := -1;      // # 5 Add line

    DecVar := (Sign * (ABS(IntegeralPart) + (FractionalPart / POWER(10,STRLEN(PartArray[2])))));  // #5 Change line

    *****End Code fix*****

     

     

    Laura K. Lake (lalake)

    Microsoft Dynamics NA


    Microsoft Customer Service and Support (CSS) North America

  • Microsoft Dynamics NAV Team Blog

    E-mail logging and The call to member Logon failed. Collaboration Data Objects returned following message: [Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]

    • 0 Comments

    In 90% of the E-mail logging errors I personally dealt with, the logon error is the most common error being filed by partner followed by The call to member Sender Failed. Collaboration Data Objects returned the following message: Collaboration Data Objects E_ACCESSDENIED(80070005). Both errors are annoying and a bit complicated to explain why this could occur.

    Let's assume for one minute yo have followed the following article:

    942793 How to set up e-mail logging in Microsoft Dynamics NAV 5.0
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;EN-US;942793

    The article indicates the E-mail logging should work by now. Fact is that the E-mail logging will probably not work and the above mentioned errors are logged. What did you do wrong? The answer is: "Nothing". Some more steps needs to be taken. Let me first describe what we need for the setup of E-mail logging.

    1. We need an Exchange 2003 or Exchange 2007 environment
    2. We need a dedicated NAS PC / Server with Outlook and Dynamics NAV client installed

     IMPORTANT NOTE:
    The NAS server with Outlook installed cannot be the Exchange Server computer:
    266418 Microsoft does not support installing Exchange Server components and Outlook on the same computer
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;266418

    3. We need a client PC plus Outlook
    4. We need a dedicated user account (let's call this account "e-mail logger") that is a SUPER user in NAV and local Admin on the NAS server / PC
    5. We need a user account for testing the E-mail logging
    6. We need the Outlook Security Settings form that ships with the ORK 2003

    IMPORTANT NOTE:
    If using Exchagne 2007, please do see the following blog I wrote earlier:
    http://blogs.msdn.com/nav/archive/2008/05/09/e-mail-logging-when-using-outlook-2007.aspx

    To avoid the MAPI_E_LOGON_FAILED error mesage, please do the followiung:
    - log on to the server or PC running NAS "using the "e-mail logger" user account 
    - configure the NAS MMC with the required properties, MAILLOG in NAV 4.0 and earlier releases and JOBQUEUE in NAV 5.0 and later releases
    - make sure the NAS service is configured with the "e-mail logger" user account via services.msc
    - create an Outlook profile for the "e-mail logger" user account => delete all other existing Outlook profiles
    - create two Public Folders for Storage and Queue

    IMPORTANT NOTE:
    Creating the two folders while being logged on as the "e-mail logger user" account means that the two folders have the "e-mail logger" user account as the owner. If the "e-mail logger" user account does not have permissions to create Public Folders, then have the Exchange Admin do this and have him manually add the "e-mail logger" user account as the orignal owner via Client Permissions within the properties of the Public Folders

    - start up Dynamics NAV client and configure the E-mail logging properties in Marketing Setup

    In general circustances, this will prevent the MAPI_E_LOGON_FAILED error messages. The NAS has direct access to the Outook Profile via the "e-mail logger" user account and the folder permissions are set OK. As the Dynamics NAV client runs on a different machien, just leave the NAS and the Outlook client running on the dedicated box.

    Most partners now get the other error message: The call to member Sender Failed. Collaboration Data Objects returned the following message: Collaboration Data Objects E_ACCESSDENIED(80070005). I will probably dedicate another full blog on that topic, but in general this can be caused by missing or ignored Outlook Security Settings form and / or Exchange Server allowing messages to come in without Sender. NAS cannot handle those message and will log the permissions error. The process will halt after that and the Queue folder will be filled with messages if an automatic way of filling the queue folder was selected.

    Also see this blog:
    http://blogs.msdn.com/nav/archive/2008/05/09/e-mail-logging-when-using-outlook-2007.aspx

    -- mmels

  • Microsoft Dynamics NAV Team Blog

    Using web services with Outlook Synchronization in a localized environment

    • 0 Comments

    While using NAS with OSYNCH parameter in a Dynamics NAV 5.0 + partnersource update 25874 or Dynamics NAV 5.0 SP1, we had to use the Localization Tips that were published on page 55 of the Setup and Installation Guide:

    When a localized version of Microsoft Dynamics NAV is used, some actions are required to align the version and country codes specified in the license (.flf) and system text (.stx) files of Microsoft Dynamics NAV C/SIDE Client, Application Server, and Outlook Add-in with the localization used.

    Important

    When you install Outlook Synchronization Update, the described alignment must be performed only after you have imported and compiled the Outlook Synchronization Update objects.
    For the details on installing the Outlook Synchronization Update, please refer to the Installing Outlook Synchronization Update appendix.

    Using SP1 this process could be easy. Using the Partnersource update, this could be a bit more difficult because at what point did you have to import the modified objects and compile them (see Note above). Using web services, this changed which is a BIG win for all of us.

    When using web services, the NAS is no longer required and there is no need anymore to copy the license and system text files manually anymore. After installing everything required and after publishing the web service in NAV, the following error will show up in the Outlook Add-in:

    NST Asynch Call completed with Error: Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException: A '=' is missing in TransferFormulaData.  WHERE(Soort=CONST(-1),Verkoper=CONST(EMS)); .

    NOTE: example has been taken from Dutch NAV 2009 CTP4.

    This is an error coming while executing the web service call to the NST (NST Asynch Call). The message we are receiving is in english, therefore it means the NST its working in english and you are filtering using translated field values in Dutch, e.g. Verkoper (Salesperson). 

    This means that you need to change the language of the NST. You do that through the Role Tailored Client, so no stx file mambo jambo anymore :-)
     
    One thing to keep in mind though, is that the values of the filters you put in the entities, are language dependent. That means that they will not change values if you suddenly change the language of the NST or NAS or classic client. You can test this on a local build by, first opening NAV on the language of the local build (let's say Dutch) on a fresh database, open the Outlook Sync. Entities or Outlook Synch User Setup tables. This will populate default values in the current language. Now, change the language into English, you’ll see that the field values are still on the local language. This can be solved actually but is a new feature.

    -- mmels 

Page 38 of 45 (669 items) «3637383940»