October, 2010

  • Microsoft Dynamics NAV Team Blog

    .NET Interoperability in NAV 2009 R2

    • 15 Comments

    The greatest development platform in the world meets the greatest set of functional libraries, types, methods, and properties as Microsoft Dynamics NAV 2009 R2 allows developers to take advantage of the Microsoft .NET Framework! With NAV 2009 R2, you can reference external .NET components and make use of the Types and Functions from .NET Framework assemblies and from your own or 3rd party code.

    Being able to use .NET from C/AL code has been planned for a long time - the whole NAV Server architecture released with NAV 2009 has been building to this time where we can finally reach out from the NAV C/AL context and make use of these functions. The feature is very much part of our roadmap going forward where we want to give developers more power and allow partners to create solutions with much broader reaches than can be achieved within a native C/AL environment.

    Referencing an external component will be similar to the pattern that Automation developers are accustomed to - you can quickly choose a component from the variable declaration window and then start using the object in C/AL with full support from NAV's Symbol Menu (F5). 

    When working with variables of type DotNet, we distinguish between two sorts: Add-ins and those registered from the Global Assembly Cache (GAC). The Add-in type are those that are custom made or custom written, they do not need to be strong-named, and they may also change or are updated often. These components must be copied into a new directory (the Add-ins directory) on the developer's C/SIDE installation in order to be utilized. Variables based on types registered in the GAC are less likely to be swapped around but support strong-named types and include components like the .NET Framework. .NET Framework components have the additional benefit that they are already deployed on computers so there is no need for additional deployment!

    Rather than elaborate more on the properties and definitions, let's look at a sample. In this code sample, we will use methods from the .NET Framework to retrieve a list of processes running on the NAV Server and show the process IDs in a message box. The sample is not exactly an ERP task but shows what can now be achieved by using .NET and hopes to show that familiar code patterns can be applied.

    This screenshot shows the whole solution:

    Notice that we have declared two DotNet variables here - myproclist, which is a System.Array and holds our list of processes, and process, which is a System.Diagnotics.Process subtype. Both variables are from the .NET Framework and are thus registered in the system GAC and we don't need to worry about deploying them for when we run the code.

    Notice also that unlike Automation (based on COM), you don't always need to CREATE the objects. In DotNet, objects need to have a constructor called when they are instance-based or they may be used directly if they are static. The GetProcesses method is a static method in .NET, as we can see in the information section in our ever-helpful Symbol Menu.

    Notice also that the C/AL code is able to loop through the Array. Using arrays (be they NAV arrays or .NET System.Arrays) is such a common programming pattern that it would be very wrong of us to not include it.

    Of course using .NET is only supported on the NAV Server and, like Automation, you can also run the .NET objects either on the NAV Server or on the RoleTailored client.

    Using .NET in C/AL will open many new options - more than we can possibly imagine. We hope you'll enjoy using this feature from NAV 2009 R2 and go on to make some fantastic new solutions for all our customers!

    Good luck and happy coding!

    Stuart

    To view a recorded version of the Hot Topic session about .NET Interoperability, see the Partner Learning Center.

  • Microsoft Dynamics NAV Team Blog

    NAV 2009 Tips and Tricks: Save Filtered Lists

    • 3 Comments

    When you work with lists, you often need to filter them and work with a subset, like customers from Germany or items in Blue location. After you create filters on a list, you can save the filtered list. This is especially useful if you have several filter parameters and you don't want to create the filters every time you start your work. You can come back to the saved filtered list any time you want.

    To Save a Filtered List

    1. To save the filtered list, click the name of the list next to the filter field.

    2. Click Save View As.

    3. Type the name for the view and choose the Activity Group to store the view.

    4. Click OK.

    5. Click Yes to restart the application.

     

     After restart the saved filter appears in the Navigation Pane.

    To Delete a Saved Filtered List

    To delete a saved filtered list, you remove it from the Navigation Pane.

    1. Right-click the saved filter in the Navigation Pane, and then click Customize Navigation Pane.

    2. In the Customize Navigation Pane window, select your filtered list, click Remove, and then click OK.

    3.  Click Yes to restart the application. After restart the saved filter no longer appears in the Navigation Pane.

  • Microsoft Dynamics NAV Team Blog

    Some tips about creating "Tree view" in List pages

    • 6 Comments

    In Microsoft Dynamics NAV 2009 in new Role Tailored Client we have new feature – we can show lists in “tree view”. We can expand/collapse nodes and make lists more interesting and more visual.

    However this new feature isn’t documented very well and every developer needs to collect his own experience. With this article I will try to make this way easierJ

    So if we want to see Tree View we need to have:

    1.       Table with field type Integer. This field will get us major point – will show is record root or fork or leaf.

    a.       Few words about “IndentationColumnName” field; (that how property to indentation field is named on Pages)

                                                                  i.      Field could be only type Integer.

                                                                ii.      Allowed values are >=0. I didn’t find upper limit, but because view indentation shift is calculated based on this value then with “big” values filed is indented too far to right that becomes invisible.

                                                              iii.      Root record has “0” indentation. Higher numbers means higher indentation. There could be several “0” records placed on table.

    2.       Page type List.

    a.       On page designer there must be “Group” & subtype “Repeater” and we need to set on it:

                                                                  i.      Property “ShowAsTree” = Yes

                                                                ii.      Property “IndentationColumnName” must be field name we defined in table as indentation field.

    b.      Repeater must include fields we want to see in list. First field in list will be indented and will have ‘+-‘ signs for collapse/expand list. Indentation field could be not included to page.

    If everything is done (and you have data in the table), then run page. Fortunately for me I have table with some data in it:

    Few interesting points I want to have your attention:

    • Field “Int” is used for primary key
    • Field “Indentation” has indentation value used for Tree View.
    • Both fields are not used on page so field “Txt” has text showing which record and what indentation level is.
    • There are no relations between primary key and indentation. You see 0 indentation is record 18.

    So run page and see:

    If we “Expand All” we’ll see:

    Wow it works J

    Please keep in mind:

    • There could be few records with the same indentation.
    • If after record ‘A’ is going record ‘B’ with bigger indentation then we can expand record ‘A’.
    • View belongs to sorting. I sorted records based on “Indentation” value. So I see “full tree” started from “0 level”. But really “0 level” record is 18 record by primary key, and if change sorting to primary key I will see different tree.

    You see now: first record has primary key 0 and indentation level 5, but next record has level 1 so my first record has no possibilities “collapse/expand”. Record 18 with level 0 is in the end of list and only one record is after it, so “my root records from previous view” now can expand/collapse only one record.

     

    And last:

    • You can’t insert manually new records to “Tree View”. Please use code if you want to create new records from “Tree view”
    • You can delete records manually from “Tree view” one by one. If you will try to delete not expanded record then only this record will be deleted.
    • You can edit records in “Tree view”. You can modify even “Indentation level” field, just after modify “Refresh” (F5) and you will see “new view”.
    • There were few stability issues in “Tree view ”, so please use possible latest NAV builds
    • If you have questions/issues regarding this functionality, please contact our best ever NAV support team J

     

    Gedas Busniauskas
    Microsoft Lithuania
    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Running classic reports in RTC (RUNMODAL and a few other things)

    • 10 Comments

    Just a few points about running classic reports from RTC, based on common support scenarios:


    RUNMODAL (Not possible)

    RTC runs classic reports (reports with no RDL Layout) by starting the report engine from a classic client. However, RTC is not able to run classic reports MODALLY. RUNMODAL as opposed to just RUN means that execution of the  next line of C/AL code waits until the report has completed. Of course RTC reports which DO have a layout can run MODALLY without any problems.

    So Report.RUNMODAL on a classic report from RTC does exactly the same as Report.RUN, i.e. RTC will launch the classic report engine but not wait for the report to finish before executing the next line of code. In most cases this doesn't matter. But the challenge is when the next line of code dependeds on the report having completed, for example to email the report, convert it to pdf, write back a result of the report to the database, or something else.

     

    Running batches of classic reports (Improvement)

    The good news is that there has been a few small other improvements relating to running classic reports from RTC. When the classic client closes, it updates a few files like the .zup file, and in the case of breakpoints having been used, also NaviBP.xml as described here:
    http://msdn.microsoft.com/en-us/library/dd355196.aspx
    In case we launched a batch of classic reports, one instance of the classic report engine would start up for each report. And each instance could overwrite each other's files, leading to error messages like this:

    You cannot use the file C:\Users\[USER]\AppData\Roaming\fin.zup  because it is already in use.

    and


    Microsoft Visual C++ Runtime Library
    Runtime Error!

    Program: C:...

     This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information. 

    But with KB 2398170 (build 31587) the behaviour is changed, so that now when the classic client closes the report engine, it willl 1) only try to update the .zup file, and 2) not try to update naviBP.xml at all, avoiding the error messages mentioned above.

     
    Licenses (No, it doesn't consume a license)

    When you run a classic report from RTC, this does NOT consume a user license. If you watch the Session table while a classic report is running, you will see that a new session has connected, but with "Application Name" = '111'. In this way the system knows not to count it as a normal NAV client, so it will not count as a concurrent session.

     

     

    Lars Lohndorf-Larsen

    Microsoft Dynamics UK

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Integrating NAV 2009 R2 with CRM 4.0

    • 19 Comments

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

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

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

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

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

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

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

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

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

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

    - Samantha Scott

  • Microsoft Dynamics NAV Team Blog

    Increased Deadlocking After Full Dynamics NAV Upgrade

    • 0 Comments

    I was recently on-site at a large Dynamics NAV customer attempting to help them get through a number of significant performance issues they encountered on their two previous failed attempts to upgrade from NAV 3.70 to NAV 5.00 SP1. In summary, they had in excess of 100 concurrent users running relatively well on NAV 3.70 with a high transaction volume. When they attempted to go live on the upgraded NAV 5.00 SP1 version they could barely get 10 users in the system without completely deadlocking each other and it was, for the lack of better term, unusable. During the previous two attempts to upgrade the partner had deployed the NAV Application Benchmark tool and coded in all the customer business cases and custom functionality to allow them to do their scalability testing (Very Cool!!). This is where I came in.

    The first thing the partner and I did was run a 30-user mixed workload test for 10 minutes on the upgraded code just to see where we were at. During this test we received over 1100 SQL deadlocks. There were so many it was difficult to even categorize where they were coming from. We reviewed the C/AL code for each of the profiles we were using and with client monitor trying to track down issues with the locking order of the tables between these processes. Sounds easy, but it's not and took a considerable amount of time. As we were scanning through the code I happened to look over the shoulder of one of the partners who had the code up on his screen for one of the processes only reports we were using and I noticed a comment in the code that caught my attention.

                //CI-Perf 1.01 140206 CI-HJS 1.00

    What first caught my attention was the word "Perf." I was very interest to know what performance modifications had been made to the code. The second thing that caught my attention was the date "140206," which means this performance enhancement dated back to 2006, when they were running NAV 3.70. Further inspection of the code revealed that several of these enhancements were to correct locking order bugs in the standard code and localization code for the 3.70 version. These changes were absolutely necessary on 3.70 to be able to achieve any type of scalability but on 5.00 SP1 they were fixing issues which no longer existed, causing several locking order violations in very key NAV processes and causing a huge number of deadlocks. We went through all the code and "unwound" these locking order changes and re-ran the benchmark tests*. Eventually we ended in a 100-user mixed workload test for 2 hours that produced > 30 deadlocks and these were on reservation entry and no. series, and we also achieved a very high transaction volume. 

    The moral of the story is when you do code upgrades from version to version, especially when you have a large gap of versions in between, be very careful what C/AL performance optimizations you bring forward from the old version to the new, and evaluate each one to make sure it is still necessary or it could end up having the absolute opposite effect on the newer version and causing performance issues.

    Thanks go out the partner who helped me work through all these issue while I was on-site!

    *There were other changes made with executable versions and SQL and database configuration that I will not detail here.

    Michael De Voe

    Senior Premier Field Engineer

    Microsoft Dynamics

    Microsoft Certified Master - SQL Server 2008

  • Microsoft Dynamics NAV Team Blog

    Let NAV PLAY! (Media Play… of course)

    • 1 Comments

    In this blog you will find the source code in order to implement a client add-in based project with Windows Media Player. You would have a wide range of possibilities to use this simple add-in and enlarge this project on your own.

    If you want to know more about client add-ins you can refer to MSDN link:

    Extending the RoleTailored Client Using Control Add-ins in Microsoft Dynamics 2009 SP1

    Step by step creation of the NavMP (NAV Media Player) add-in:

     (always remember the 'DodgeBall' rules: Develop, Sign, Place, Register, and Develop)

    1. DEVELOP your add-in (in Visual Studio)
    2. Strong SIGN and Build
    3. PLACE DLLs into Add-ins folder
    4. REGISTER the add-in in Table 2000000069, Client Add-in
    5. DEVELOP your C\AL code (in Object Designer)

    My ingredients:

    • Visual Studio 2010 Professional
    • Windows 7 Enterprise
    • Windows Media player 12

    DodgeBall rule 1: DEVELOP your add-In (in Visual Studio)

    A. Create a New Class project

    1. Open Visual Studio (in this example I am using Visual Studio 2010)
    2. Create a New Project (CTRL+SHIFT+N) with these parameters:
    •  
      • Visual C# - Windows
      • Class library
      • .NET Framework 3.5
      • Name: NavMP
      • Location: C:\TMP (or whatever location you like)
      • Solution Name: NavMP
      • Create directory for solution

     

    B. Create a Strong Name Key (SNK)

    1. Go to Project > Properties (NavMP Properties...)
    2. From the Project Properties form go to the Signing tab
    3. Tick the Sign the assembly option
    4. Create a New SNK (e.g. NavMP.snk)

     

    C. Add a Windows Form to the class project and modify its properties

    1. In the main menu click on "Project" > "Add New Item" (Ctrl + Shift + A)
    2. Select "Windows Form"
    3. Click "Add"
    4. In this way, Visual Studio has added a brand new Windows Form to your project and inherit all the necessary references.

     

    • The brand new Form should be added to your project. And you just simply need to change the Form properties as reported below:
    Property Value
    AutoScaleMode None
    Autosize True
    FormBorderStyle None
    Locked True
    MaximizeBox False
    MinimizeBox False
    Size 212;207
    Text NAV Media Player

     

    D. Add a Media Player object  to the class project and modify its properties

    1. Normally, a Media Player object is not present as an item in the Toolbox. In order to add it you need to have Media Player installed in your machine. Then, you can just follow the next steps or simply refer to this useful How To video: http://msdn.microsoft.com/en-us/vcsharp/bb798025.aspx
    2. Go to the Toolbox and scroll down to the last available space ("General" group)
    3. Click on General > Right-click in the blank area > Select "Choose Items"

    • In the "Choose Toolbox Items" form > Select tab "COM Components" > check on "Windows Media Player" and click OK

    • Now the Windows Media Player item should be added to your toolbox

     

    • Select the Windows Media Player item and drop it into the Form created before

    • Right click on the Windows Media Player control added and click on "Properties"
    • Change the Windows Media Player properties as reported in the screens below and click OK

    • Change the Windows Media Player control item properties added to the Form
    Property Value
    (Name) NAVMediaPlayer
    Anchor Top, Bottom, Left, Right
    Ctlenabled True
    enableContextMenu True
    fullScren False
    Location 0;0
    Locked True
    Margin 2;2;2;2
    Size 287;256
    stretchToFit True
    uiMode full
    windowlessVideo False

     

    If you want to know more about the player object visit http://msdn.microsoft.com/en-us/library/dd564034(v=VS.85).aspx.

    E. Add remaining References to the project

    1. In the Solution Explorer window select "Reference", right-click "Add Reference"
    2. Add a reference to Microsoft.Dynamics.Framework.UI.Extensibility

    F. Develop (add code to) your NavMP project

    1. Locate your Form1.cs file in the Solution Explorer
    2. Right-click > View Designer (Shift+F7)

    • Replace the C# code with the one written below (or copy that from the image)

     

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Linq;

    using System.Text;

    using System.Windows.Forms;

     

    namespace NavMP

    {

        public partial class Form1 : Form

        {

            public Form1()

            {

                InitializeComponent();

            }

            private void NavMediaPlayer_Enter(object sender, EventArgs e)

            {

                string MoviePath = @"C:\TMP\Presentation.avi";

                NavMediaPlayer.settings.autoStart = false;

                NavMediaPlayer.URL = MoviePath;

            }

        }

    } 

    • Now, you need to add some code also in the Class
    • Right-click on the form and select "View Designer" (Ctrl + F7)
    • Select the Media Player control
    • Right-click on it and select "View Code" (F7)

    • Replace the C# code with the one written below (or copy that from the image)

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Linq;

    using System.Text;

    using Microsoft.Dynamics.Framework.UI.Extensibility;

    using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms;

    using System.Windows.Forms;

    using System.Drawing;

     

    namespace NavMP

    {

        // WinFormsControlAddInBase

        [ControlAddInExport("Cronus.DynamicsNAV.NMediaPlayer")]

        [Description("Let this Add-in Media Play")]

     

        public class TestMPClass : StringControlAddInBase

        {

            // Form

            protected override Control CreateControl()

            {

                Form1 MPForm = new Form1();

                MPForm.TopLevel = false;

                MPForm.Visible = true;

                return MPForm;

            }

        }

    }

    DodgeBall rule 2 : Strong SIGN and build

    1. Now it is all set up, you are ready to build your client add-in. In the main menu, go to "Build" > "Build NavMP". (This is automatically strong signed as per rule 1 point B.)

    DodgeBall rule 3 : PLACE DLLs into Add-In folder

    1. Locate/copy/paste NavMP.dll, AxInterop.WMPLib.dll and Interop.WMPLib.dll (should be in your \NavMP\NavMP\bin\Debug folder) in the Add-ins folder of a machine where the RoleTailored client has been installed (typically C:\Program Files\Microsoft Dynamics NAV\60\RoleTailored Client\Add-ins).

    DodgeBall rule 4 : REGISTER the Add-in in Table 2000000069 Client Add-in

    1. Launch the Visual Studio Command Prompt (VSCP)
    2. In the VSCP:

    Sn -T "C:\TMP\NavMP\NavMP\bin\Debug\NavMP.dll"

     dfcb4863cf7c4cb0 is the PKT (Public Key Token) needed to register the AddIn into NAV.

    (You will probably have another value, this is just an example)

    • Open Classic Client
    • Open Object Designer (SHIFT+F12)
    • Select Table object (ALT+B)
    • Run Table 2000000069 Client Add-in
    • Insert a new line with these values:
    • Field Value
      Control Add-in Name Cronus.DynamicsNAV.NMediaPlayer
      Public Key Token dfcb4863cf7c4cb0 (this is an example)
      Version 1.0.0.0
      Description Let this Add-in Media Play

    DodgeBall rule 5 : DEVELOP your C/AL code

    1. Copy/paste the Txt format code written below in a new Notepad object or download the Txt file from the bottom of this blog

    OBJECT Page 50100 Nav Media Player

    {

      OBJECT-PROPERTIES

      {

        Date=;

        Time=;

        Modified=Yes;

        Version List=;

      }

      PROPERTIES

      {

        SourceTable=Table18;

        DataCaptionExpr=Text10000000;

        PageType=CardPart;

      }

      CONTROLS

      {

        { 1101100000;0;Container;

                    ContainerType=ContentArea }

     

        { 1101100001;1;Field  ;

                    ControlAddIn=[Cronus.DynamicsNAV.NMediaPlayer;PublicKeyToken=dfcb4863cf7c4cb0] }

      }

      CODE

      {

        VAR

          Text10000000@1101100000 : TextConst 'ENU=LET NAV Play !';

        BEGIN

        {

          WARNING ----------------------------------------------------------------------------

          YOU NEED TO CHANGE THE PublicKeyToken WITH THE ONE ASSIGNED TO YOUR OBJECT !!!

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

        }

        END.

      }

    }

    • Import the txt object
    • Compile the txt object newly created (Page 50100 Nav Media Player)
    • IMPORTANT: Create an AVI file called Presentation.avi in your C:\Tmp directory (create the directory as well, where needed)
    • Run Page 50100 Nav Media Player
    • Enjoy it!!!

    This simple client add-in project may be used in, e.g.

    • Customer general presentations
    • Stream MP3 files
    • ... and many more

    This simple client add-in project may be enlarged, e.g.

    • It could be possible to enlarge the project and bound this to a field in order to play whatever file in a share (no hardcoded c:\tmp\Presentation.avi)
    • ... and many more

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

    Duilio Tacconi (dtacconi)

    Microsoft Dynamics Italy

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Outlook Synchronization and baseline implementation for Dynamics NAV 5.0 SP1 and Dynamics NAV 2009 SP1

    • 0 Comments

    Since the initial 5.0 release, so many patches were released by Microsoft that took care of Outlook Synchronization feature, that one could imagine that you are lost. This blog posting tells you what is required for Dynamics NAV 5.0 SP1 and Dynamics NAV 2009 SP1.

    Baseline Implementation for Dynamics NAV 5.0 SP1 systems:

    1. Dynamics NAV NAS of build 26084 or 30488
    2. Client PC of build 26084 or 30488, Dynamics NAV CSIDE Client of build 26084 or 30488, Office 2007 SP2 plus August 2010 Rollup patch for Office 2007 SP2 and Outlook Add-In of build 29763 (KB974523) and build 30991 (KB983614)

    974523 Error message when you synchronize multiple contact records in Microsoft Dynamics NAV 5.0 to Microsoft Office Outlook: "Access to path EntryIdStorage was denied"
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;EN-US;974523

    983614 "The related item for the synchronized Outlook item is not found in the specified folders" error message when you synchronize meetings from Microsoft Dynamics NAV 5.0 Service Pack 1 to Microsoft Outlook
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-US;983614

    3. ensure Text Constant Text120 of CU5300 is set to Links and not to a localized translated value

    Correction if text constant Text120 of CU5300 is not set to Links:

    • go to Tools / Object Designer
    • select Codeunit
    • select Codeunit5300 Outlook Synch. Setup Mgt.
    • press Design
    • select View / C/AL Globals
    • select Text Constants
    • select Text120
    • replace the translated value to the word Links
    • save and compile Codeunit 5300

    Now reset the default entities to default values:

    • go to Administration, Application Setup, Microsoft Office Outlook Integration
    • select Outlook Synch. User Setup
    • select everything and press F4
    • confirm the deletion
    • go to Administration, Application Setup, Microsoft Office Outlook Integration
    • select Outlook Synch. Entities
    • select Code and press F5
    • select CONT_SP Microsoft Dynamics NAV Salespeople
    • select Synch. Entity button and select Reset to Defaults…
    • repeat steps 8 and 9 for all other entities in order CONT_COMP, CONT_PERS, TASK and APP

      Results of this correction for APP entity:

      image

      image

      Results of this correction for TASK entity:

      image

      image

    NOTE: the whitepaper is wrong around this topic. We used to recommend to update the Outlook Collection for APP and TASK entity manually and then select Links from the lookup. This actually destroys the references as shown in the second screenshot (Outlook Synch. Entity APP 10000 – Outlook Synch. Fields) and fourth screenshot (Outlook Synch. Entity Element Task 30000 – Outlook Synch Fields).

    4. apply a performance update preventing the system to do a full table scan:

    2288271 A time-out error occurs when the Outlook Synchronization process is run from Microsoft Office Outlook to synchronize with Microsoft Dynamics NAV
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-US;2288271

    5. apply a hot fix that solves an issue with attendee validation:

    2291055 "Contact No. '[Contact_number]' does not exist" error message when you perform an Outlook synchronization to synchronize with Microsoft Dynamics NAV 2009 SP1
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-US;2291055

    6. before performing a Full Synchronization for the first time, switch the Synch. Direction for APP and TASK entity to Dynamics NAV to Outlook
    7. verify Table13 Salesperson/Purchaser do not list any E-mail addresses for the Outlook Synch users
    8. on the NAS server, log on as the user that is configured to start up the NAS Server service and verify the Regional Settings matches the language of the release of Dynamics NAV you are working with

    image

    9. verify the correct fin.stx and cronus.flf file exists in the %ProgramFiles%\Microsoft Dynamics NAV\Application Server folder

    Copy fin.stx from %ProgramFiles%\Microsoft Dynamics NAV\CSIDE Client\language
    Copy cronus.flf from %ProgramFiles%\Microsoft Dynamics NAV\CSIDE Client

    Follow the official whitepaper on page 55 (see extract below) for the other files: 
    https://mbs.microsoft.com/partnersource/downloads/releases/NAV50OutlookInt

    image

    10. for the first Outlook Synch user, only add CONT_SP entity and register CONT_SP entity in the Change Log via Setup button Register in Change Log Setup
    11. configure the Outlook Add-In and perform a Full Synchronization, populate the E-mail addresses for the synchronized contacts and perform a normal Synchronization to update Table13 Salesperson/Purchaser with correct E-mail addresses taken out of the Exchange Global Addresses
    12. continue and finish the setup of the Outlook Synchronization User Setup for all other users
    13. for each added line in the Outlook Synch User Setup, register the entities in the Change Log via Setup button and then select Register in Change Log Setup
    14. ensure the Outlook Add-In is configured with the following settings:

    image

    • do not use Schedule automatic synchronization every x minutes
    • ensure Show synchronization progress is enabled
    • ensure Show synchronization summary is enabled

    15. ensure the Outlook Synch users are aware the synchronization should not be stopped in between a Full Synchronization or normal Synchronization to prevent duplication of contacts

    Baseline Implementation for Dynamics NAV 2009 SP1 systems:

    1. Dynamics NAV NAS of build 29626 or Dynamics NAV NST of build 29626
    2. Client PC of build 29626, Dynamics NAV CSIDE Client of build 26084 or Role Tailored Client of build 29626, Office 2007 SP2 plus August 2010 Rollup patch for Office 2007 SP2 and Outlook Add-In of build 29626 plus mapihelper.dll of build 29958

    975339 You cannot synchronize meetings and tasks as expected between Microsoft Dynamics NAV 2009 Service Pack 1 and Microsoft Office Outlook
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;EN-US;975339

    3. ensure Text Constant Text120 of CU5300 is set to Links and not to a localized translated value

    4. apply a performance update preventing the system to do a full table scan:

    2288271 A time-out error occurs when the Outlook Synchronization process is run from Microsoft Office Outlook to synchronize with Microsoft Dynamics NAV
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-US;2288271

    5. apply a hot fix that solves an issue with attendee validation:

    2291055 "Contact No. '[Contact_number]' does not exist" error message when you perform an Outlook synchronization to synchronize with Microsoft Dynamics NAV 2009 SP1
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-US;2291055

    6. before performing a Full Synchronization for the first time, switch the Synch. Direction for APP and TASK entity to Dynamics NAV to Outlook
    7. verify Table13 Salesperson/Purchaser do not list any E-mail addresses for the Outlook Synch users
    8. on the NAS server, log on as the user that is configured to start up the NAS Server service and verify the Regional Settings matches the language of the release of Dynamics NAV you are working with
    9. verify the correct fin.stx and cronius.flf file exists in the %ProgramFiles%\Microsoft Dynamics NAV\Application Server folder
    10. if working with NST, then start up the Role Tailored Client and change language to match the language of the release of Dynamics NAV you are working with
    11. for the first Outlook Synch user, only add CONT_SP entity and register CONT_SP entity in the Change Log via Setup button Register in Change Log Setup
    12. configure the Outlook Add-In and perform a Full Synchronization, populate the E-mail addresses for the synchronized contacts and perform a normal Synchronization to update Table13 Salesperson/Purchaser with correct E-mail addresses taken out of the Exchange Global Addresses
    13. continue and finish the setup of the Outlook Synchronization User Setup for all other users
    14. for each added line in the Outlook Synch User Setup, register the entities in the Change Log via Setup button and then select Register in Change Log Setup
    15. ensure the Outlook Add-In is configured with the following settings:

    • do not use Schedule automatic synchronization every x minutes
    • ensure Show synchronization progress is enabled
    • ensure Show synchronization summary is enabled

    16. ensure the Outlook Synch users are aware the synchronization should not be stopped in between a Full Synchronization or normal Synchronization to prevent duplication of contacts

    System requirements of Dynamics NAV 5.0 SP1, Dynamics NAV 2009 and Dynamics NAV 2009 SP1 still lists Office 2003 SP3 as a minimum requirement. CSS confirms this but also acknowledges that some filter settings in localized releases of Office 2003 SP3 won’t work while these do work in Office 2007 SP2 and later releases of Office. That is why I would suggest to at least bring your Office release up to Office 2007 plus August 2010 Rollup patch for Office 2007 SP2!

    Truly hopes this helps to clear the confusion.

    Regards,

    Marco Mels
    CSS EMEA

    This posting is provided "AS IS" with no warranties, and confers no rights

  • Microsoft Dynamics NAV Team Blog

    Outlook Synchronization and some core features of Terminal Server

    • 0 Comments

    At the moment we see an incoming volume of support cases regarding Outlook Synchronization and core features of Terminal Server. That would be a good subject for a new blog. Partners would like to setup roaming profiles, mandatory profiles and maybe even setup Network Load Balancing so that the end user does not know to what Terminal Server they are logging on to. Let me shed some light of the difficulties we have encountered with this while analyzing if this scenario can be setup without too much troubles.

    The Outlook Add-In settings are stored in the following folder:

    Windows Vista %userprofile%\AppData\Local\Microsoft Dynamics NAV\OutlookSynch
    Windows 7 %userprofile%\AppData\Local\Microsoft Dynamics NAV\OutlookSynch
    Windows 2003 %userprofile%\Local Settings\Application Data\Microsoft Dynamics NAV\OutlookSynch
    Windows 2008 %userprofile%\AppData\Local\Microsoft Dynamics NAV\OutlookSynch

    As the folder path already suggested, the settings files are stored in the local part of the user profile. By default of the operating system, this part of the user profile does not roam. To workaround this issue, you could use a Group Policy where you configure the ExcludeProfileDirs registry or you configure a logon script in which you explicitly set this registry key on the clients PC or within the RDP-session. The local settings part of the user profile will then roam along with the user profile to the network server where all the roaming user profiles are stored.

    More information about this key and the corresponding Group Policy can be found here:
    http://technet.microsoft.com/nl-nl/library/cc728399(WS.10).aspx

    Many Terminal Servers administrators also want to configure a specific Group Policy Object called: Delete cached copies of roaming profiles. More information can be found here: 
    http://technet.microsoft.com/en-us/library/cc958989.aspx

    This policy may be used in combination with a Terminal Server farm where the user is load balanced across the several available Terminal Servers.

    However, in Dynamics NAV 5.0 SP1 and later releases of Dynamics the files that are stored in the OutlookSynch folder are encrypted with an an encryption key that is stored in the user profile as well.

    Windows Vista %userprofile%\AppData\Roaming\Microsoft\Crypto\RSA\%SID%
    Windows 7 %userprofile%\AppData\Roaming\Microsoft\Crypto\RSA\%SID%
    Windows 2003 %userprofile%\Application Data\Microsoft\Crypto\RSA\%SID%
    Windows 2008 %userprofile%\AppData\Roaming\Microsoft\Crypto\RSA\%SID%

    The files can be viewed with notepad and should contain a text value XML_ENC_OL_KEY.

    If there are problems with this key, then the following error message may show up:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.Security.Cryptography.CryptographicException: Bad Data.

       at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
       at System.Security.Cryptography.Utils._DecryptKey(SafeKeyHandle hPubKey, Byte[] key, Int32 dwFlags)
       at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP)
       at System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter.DecryptKeyExchange(Byte[] rgbIn)
       at System.Security.Cryptography.Xml.EncryptedXml.DecryptKey(Byte[] keyData, RSA rsa, Boolean useOAEP)
       at System.Security.Cryptography.Xml.EncryptedXml.DecryptEncryptedKey(EncryptedKey encryptedKey)
       at System.Security.Cryptography.Xml.EncryptedXml.GetDecryptionKey(EncryptedData encryptedData, String symmetricAlgorithmUri)
       at System.Security.Cryptography.Xml.EncryptedXml.DecryptDocument()
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.DataSetEncryption.Decrypt(String encryptedDataSet)
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.PersistentStorage.<LoadSynchronizationEntityFilterDS>b__2(DataSet newSet, FileStream reader)
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.PersistentStorage.LoadDS(DataSet newSet, String setName, ReadDelegate specialRead)
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.PersistentStorage.LoadSynchronizationEntityFilterDS()
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.SettingsForm.LoadFolderControls()
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.SettingsForm.LoadSettings()
       at Microsoft.Dynamics.NAV.OLSync.NAVSyncAddIn.SettingsForm.SettingsForm_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    From development:
    If you experience it works on one machine but not on the other please check this setting on both machines- it might be as simple as the key not being copied. Only one file should exist with the above text value and it should be exactly the same file. If you find a difference I suggest you log the user off from all the machines, delete the outlook integration settings + machine key and recreate it by setting up the synchronization again.  If you're working on a "large sync data" user you can try, copying the key from a working machine to the non working machine or by moving keys out of the folder so there's only one.

    Currently it's not possible to disable encryption.

    From CSS perspective:
    Since it is not possible to disable encryption at this moment, we now suggest to move the Outlook Synch users to a specific Organizational Unit where you exclude them from having roaming profiles / mandatory profiles, etc. The user profile should be stored locally. There is too much work to do to correct a failure in the encryption of the files that are stored in the \OutlookSynch folder.

    Regards,

    Marco Mels
    CSS EMEA

    This posting is provided "AS IS" with no warranties, and confers no rights

  • Microsoft Dynamics NAV Team Blog

    NAV 2009 Tips and Tricks: Customize your Action Pane

    • 0 Comments

    You can make many customizations to the RoleTailored client Action Pane: You can create your own grouping of key tasks. You can add the actions and tasks you use most to your pages. You can combine those tasks in groups. And, you can change the size of icons so that the most important ones pop out!

    The Action Pane is a part of all RoleTailored pages, including list places, journals, and cards.

    1. To start customizing the Action Pane, click Customize .

    2.Click Customize Action Pane.

    3. To add a new Action Pane group, click Add to the right of Groups list.

     

    4. In the Name field, enter the name of your new actions group and click OK.

    5. Use Move Up, Move Down and Rename buttons to change the position and name of the group.

    6. To add a new action to a group, select the group you want to add the action to.

    7. Click Add to the right of Actions list.

    8. Browse to the action and click OK.

     

    9. Repeat steps 7 and 8 for every action you want to add.

    10. To change the size of an action icon, click Change Size. If small, the icon will increase in size. If large, the icon will decrease in size. Use Move Up and Move Down to change the position of the action.

    11. Click OK to close the Customize window.

     

    The following illustration shows a customized Action Pane for a sales order. It has an new action group, Approvals, two added tasks, and an icon with a largesize.

    For more information about usability and the RoleTailored client, see the blog post Useful, Usable, and Desirable.

  • Microsoft Dynamics NAV Team Blog

    C/SIDE Improvements in Dynamics NAV 2009 R2

    • 21 Comments

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

    1. CTRL+F12

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

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

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

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

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

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

    2. Lock/Unlock of Application Objects

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

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

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

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

     3. Page Designer Improvements

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

    Figure 3 - FactBox picker in the New Page Wizard.

     4. Structure Highlighting

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

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

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

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

    Thank you!

    Stuart 

  • Microsoft Dynamics NAV Team Blog

    Outlook Synchronization and working with Tasks and Appointments

    • 0 Comments

    For troubleshooting and to prevent duplication of contacts and to-do’s in Dynamics NAV, CSS sometimes request you to clear the contents from the main Calendar, Contacts and main Tasks folders before the next Full Synchronization. As a result of this, the synchronized to-do’s may not show up or may show up as closed entries. For the Contacts folders assigned to the Outlook Synchronization, this is not a problem. After the next Full Synchronization, the contacts show up again. For the to-do’s, this may become an issue.

    To prevent this, we now recommend before a Full Synchronization attempt, to switch the Synch. Direction for the APP and TASK entity from Bidirectional to Microsoft Dynamics NAV to Outlook. The Outlook Synch User Setup may look like this.

    image

    If there are many items to synchronize during a Full Synchronization, it is a best practice to limit the data to be synchronized all at once and perform a couple of Full Synchronization attempts instead. A filter or condition for TASK and APP entity could look like this:

    image

    NOTE: this filter ensures that only to-do’s that have a starting date of 01/01/09 till 31/12/09 for the TASK and APP entity are synchronized for the salesperson with code MME. After the Full Synchronization, you could update the filter for TASK and APP entity again to synchronize the other to-dos’:

    image

    After that, you could remove the Starting Date criteria so that to-do’s that have a starting date outside the filter range, will be synchronized as well.

    NOTE: of course, you need set the initial Starting Date to match the first created to-do in Dynamics NAV or the first created to-do you actually want to be synchronized to Outlook. After that you need to ensure you precisely define the filter criteria. E.g.: if there are 1000 to-do’s in 2009, then you could split these up so that to-do’s will be synchronized per quarter of the year. This means, you will end up with four times a Full Synchronization in stead of one long running synchronization attempt.

    So, what to do if the Calendar and Tasks folders in Outlook already contain calendar items and task items that either should not be synchronized to Dynamics NAV or should be synchronized to Dynamics NAV thus should not be deleted prior to the Full Synchronization attempt. Following up CSS requests to clear the Outlook Synchronization folders would destroy data that is important for the business or for the end users. For this, you could easily use the filter settings in the Outlook Add-In.

    The following defined filter criteria could be used as an example:

    image

    This filter will ensure that created calendar items and created tasks items in Outlook will not be synchronized if they match the defined filter criteria. That taken into account, after a Full Synchronization and after switching the Synch Direction to bidirectional, synchronized to-do’s will show up in Outlook, but they won’t be synchronized to Dynamics NAV if they are updated in Outlook because they match the defined filter criteria. If a synchronized to-do is modified in Outlook, the end user will have to assign a category to the calendar or task entry. At that point, the updated calendar entry or task entry will be updated to Dynamics NAV after a normal Synchronization.

    image

    CSS also noticed that after upgrading from Outlook 2007 to Outlook 2010, the defined Outlook Synchronization folders for the contact entities may no longer have the checkbox enabled for Show this folder as an e-mail Address Book. This generates errors when trying to synchronize to-do’s from Dynamics NAV to Outlook when attendees are assigned to the to-do. A created calendar item (Meeting Request) in Outlook could not be populated with a synchronized contact from Dynamics NAV because the Address Book is not shown. To populate this checkbox again, right click on the defined Outlook Synch contacts folders for Company contacts, Person contacts and Salesperson contacts as shown in the example below.

    image

    Last but not least when working with Tasks and Appointment in an Exchange Server environment, CSS required you to initially create the Salespersons in Dynamics NAV without the E-mail address. After the initial Full Synchronization, the synchronized contact in the Outlook Synchronization folder defined for the Salespersons contact, needs to be populated with the E-mail address taken from the Exchange Global Address Book and then synchronized back to Dynamics NAV. It is a good practice to use one user account for this, synchronize all the salespersons all at once, perform a Full Synchronization, update them all at once and then perform  a normal Synchronization to update table 13. In the first screenshot, you can see I am using the Administrator account for that. For all other Outlook Synch Users, this procedure is no longer necessary because the correct information is already in Dynamics NAV.

    Regards,

    Marco Mels
    CSS EMEA

    This posting is provided "AS IS" with no warranties, and confers no rights

  • Microsoft Dynamics NAV Team Blog

    What's new in R2 for reporting

    • 8 Comments

    With Microsoft Dynamics NAV 2009 R2 it is time to drill into the new features we have for you in the reporting area.

    Enhanced connection with Visual Studio when editing layout (RDLC)

    a. Easy refresh of dataset in Visual Studio

    In NAV 2009 SP1 you had to close down Visual Studio when you made any modifications to the dataset (Section designer). With NAV 2009 R2 you can keep both the NAV Report designer and Visual Studio Layout designer open.

    To see this feature in action

    1. Open a report in design mode and select “View/Layout”

    2. With both Report Designer and Visual Studio window, open add new field to the dataset (Section Designer)

    3. Now, to activate the refresh action you need to both save and compile. Only saving, or only compiling the report, will not activate the dataset refresh action in Visual Studio.

    4. Navigate back to Visual Studio and you will see this message:

    image

    5. Select “Yes” to accept the Refresh

    6. Lastly, right click ”Result” under ”DataSet”, and select Refresh

    image

    Or

    Select the Refresh Button

    image

    7. You will now see your new added item to the dataset, and you can now add this to your layout.

    b. Better protection when closing Report Layout in Visual Studio

    In NAV 2009 SP1, it was possible to accidentally close down the Report Designer in NAV and thereby leaving Visual Studio with the Layout open in an unsaved state. With NAV 2009 R2 it is no longer possible to close down the Report Designer in NAV without closing Visual Studio first.

    To see this feature in action:

    1. Open a report in design mode and select “View/Layout”

    2. With both Report Designer and Visual Studio window open, try closing the NAV Report Designer window. You will see this message:

    image

    c. Better protection when opening report layout for design in Visual Studio

    In NAV 2009 SP1 it was possible to accidentally open several version of the same report layout in Visual Studio. This can easily cause confusion, so with NAV 2009 R2 it is no longer possible to open several versions of the layout in a report.

    To see this feature in action:

    1. Open a report in design mode and select “View/Layout”

    2. With both Report Designer and Visual Studio window open select “View/Layout” again and you will see this message:

    image

    Printer Selections now available in Role Tailored client

    In NAV 2009 SP1 the only way to define which reports should be printed to which printers was in the Printer Selections form as Printer Selections did not work from Role Tailored client. So you had to have the Classic client installed to configure the Printer Selections in NAV 2009 SP1. You could of also have use the workaround described here: http://blogs.msdn.com/b/nav-reporting/archive/2009/10/19/printer-selections-in-role-tailored-client.aspx

    With NAV 2009 R2 we now have Printer Selections working from Role Tailored client.

    To see this feature in action:

    1. Open Role Tailored client and type “Printer” in the search box

    image

    2. Select Printer Selections and you get this page:

    image

    3. To edit the list or create a new select “New” and you will be able create a new or edit what you already have defined:

    image

    New action images for PDF

    You might have seen my blog post on how to send an e-mail with a report attached as a PDF file.
    If you have not seen this here is the link: http://blogs.msdn.com/b/nav/archive/2009/10/08/send-email-with-pdf-attachment-in-nav-2009.aspx

    In NAV 2009 R2 we have some new icons which we can use.

    So if you want to send an e-mail with a report attached as a PDF file in NAV 2009 R2, you might want to consider using the image called: “SendEmailPDF

    And if you want to save a report as a PDF file from RoleTailored client, you might want to use the image called:” SendAsPDF

    And yes it would be great if guys one day could add your own icons to the RoleTailored client. Hopefully we will have this feature in a future version of NAV.

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

    This is what I had to share today; I hope you appreciate the new reporting features which will be available in NAV 2009 R2. And as always I’m happy to get feedback about reporting features you would like for us to implement in future releases. So use the Contact Form to write directly to the core reporting team or use MS Connect to give suggestions:https://connect.microsoft.com/dynamicssuggestions

    Thanks,
    Claus Lundstrøm, Program Manager, Microsoft Dynamics NAV

  • Microsoft Dynamics NAV Team Blog

    Where does RTC find the classic client for running classic reports?

    • 4 Comments

    When you start a classic report from RTC (a report with no layout defined), it starts the report engine from the classic client. It can happen that after updating RTC, you end up with a version of RTC which is not compatible with the default classic client. In this case you will typically get this error message when trying to run the report:

    Microsoft Dynamics NAV Classic client was opened from an untrustworthy component. Contact your system administrator.


    Or if you have a test machine with multiple versions of RTC and classic you may want to start the classic client from another folder.


    RTC finds the location of Finsql.exe in this place in registry:


    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\


    So if you have any of the issues above, make sure that the classic client in this folder matches the version of RTC.

     

     

    Lars Lohndorf-Larsen

    Microsoft Dynamics UK

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    MagicPath (DOWNLOADFROMSTREAM and UPLOADINTOSTREAM without a dialog box)

    • 8 Comments

    The C/AL commands DOWNLOADFROMSTREAM and UPLOADINTOSTREAM have the purpose of sending files between RTC and the NAV Server. A few times now, we had the question: How can we use these functions without it displaying the dialog box to select a file and folder name?

    This is how you can automatically download and upload files without any user interactions:

    The trick is to use MagicPath, like in codeunit 419 "3-Tier Automation Mgt.". MagicPath is initiated by setting the folder name to '<TEMP>' like this:
    DOWNLOADFROMSTREAM(IStream,'','<TEMP>', '',MagicPath);

     

    DOWNLOADFROMSTREAM

    The code example below will copy a specific file from the NAV Server to the RTC machine with no questions asked about folder or file name or anything else:


    IF NOT ISSERVICETIER THEN
      EXIT;
    FileToDownload := 'c:\Temp\ServerFile.txt';
    FileVar.OPEN(FileToDownload);
    FileVar.CREATEINSTREAM(IStream);
    DOWNLOADFROMSTREAM(IStream,'','<TEMP>', '',MagicPath);
    MESSAGE('Path = ' + MagicPath);

    FileVar.CLOSE;

     

    Variables:

    Name Data Type Length
    FileToDownload  Text 180
    FileVar File
    IStream  InStream
    MagicPath  Text 180

     


    Now we have the file on the RTC machine, and MagicPath tells us its location. The location will be something like this:
    C:\Users\[UserName]\AppData\Local\Temp\Microsoft Dynamics NAV\4612\__TEMP__ff7c5a286cfd463f9f7d92ae5b4757e2

    The number 4612 in the MagicPath comes from the Process ID of RTC.

     

    Handling files client side

    So, what if we wanted to rename it to a specific name? We have the FILE object in C/AL, but of course since C/AL runs on the NAV Server and not on RTC, this won't work since the purpose of the above is exactly to copy the file to the client machine. Instead, use this automation:

    'Microsoft Scripting Runtime'.FileSystemObject

    Then create an instance ClientSide:
    CREATE(FileSystemObject,TRUE,TRUE);


    So, if you wanted to continue the code above and place and name the file to something specific on the client's machine, add these lines:


    CREATE(FileSystemObject,TRUE,TRUE);
    DestinationFileName := 'c:\Temp\newfile.txt';
    IF FileSystemObject.FileExists(DestinationFileName) THEN
      FileSystemObject.DeleteFile(DestinationFileName,TRUE);
    FileSystemObject.CopyFile(MagicPath,DestinationFileName);
    FileSystemObject.DeleteFile(magicpath,TRUE);

     

     
    UPLOADINTOSTREAM


    MagicPath works both ways. But with DOWNLOADFROMSTREAM it creates MagicPath for you and tells you where it is. With UPLOADINTOSTREAM you need to know it in advance. Remember the MagicPath location above includes the Process ID of RTC. One way could be to work that out somehow. But what I would suggest instead, is to download a temp test file first, then see where MagicPath downloads it to. The path for upload will be the same:


    // download a temp file to get MagicPath
    FileVar.CREATETEMPFILE;
    FileVar.CREATEINSTREAM(IStream);
    DOWNLOADFROMSTREAM(IStream,'','<TEMP>', '',MagicPath);
    FileVar.CLOSE;
    MESSAGE(MagicPath);


    Then extract the folder name from MagicPath:

    FOR i := STRLEN(MagicPath) DOWNTO 1 DO BEGIN
      IF MagicPath[i] = '\' THEN BEGIN
        MagicPath := COPYSTR(MagicPath,1,i);
        i := 1;
      END;
    END;

    Once you know the location of MagicPath, the next step is to copy the file you want to upload into that folder:

    FileToUpload := 'newfile.txt';
    FolderName := 'c:\Temp\';

    IF ISCLEAR(FileSystemObject) THEN
      CREATE(FileSystemObject,TRUE,TRUE);
    FileSystemObject.CopyFile(FolderName + '\' + FileToUpload,MagicPath + '\' + FileToUpload);

    Then use UPLOADINTOSTREAM to upload the file from MagicPath to the NAV Server:
    UPLOADINTOSTREAM('','<TEMP>','',FileToUpload,IStream);


    And finally, save the InStream to a file on the server:

    FileVar.WRITEMODE(TRUE);
    FileVar.CREATE('c:\Temp\OnServer.txt');
    FileVar.CREATEOUTSTREAM(OStream);
    COPYSTREAM(ostream,istream);
    FileVar.CLOSE;

     

    So, put all this together and the end result is:

    The file c:\Temp\ServerFile.txt gets downloaded to C:\Temp\NewFile.txt, and then uploaded back to the server as C:\Temp\OnServer.txt.

     

     

    Lars Lohndorf-Larsen

    Dynamics NAV Support EMEA

     

     

     

     

     

Page 1 of 2 (16 items) 12