Microsoft Dynamics NAV

Team Blog

December, 2010

  • Microsoft Dynamics NAV Team Blog

    New VAT Registration Number in Switzerland

    • 0 Comments

    From 1.1.2011, Switzerland will enforce a new Tax Number called UID (Unternehmens-Identifikationsnummer). Authorities will assign new tax numbers to all new tax persons instead of old 6-digit VAT Registration Number. Existing tax persons will be informed of their new tax number in the first semester of 2011. During the period from 2011 - 2013 both old and new VAT Registration Numbers can be used. In first quarter of 2011 we expect further communication from Swiss authorities on potential changes in VAT Reporting related to this change.

    Currently in the Swiss version of NAV 5.0 SP1 and NAV 2009 SP1 (and R2) we store tax number in the VAT Registration field in Company Information and in the UID field in the Payroll module. Keep in mind you will need to change VAT Registration Numbers for all your Swiss Customers, Vendors and Contacts.

    Some information on new tax Numbers:

    • The new tax number is a unique number to identify a company
    • It will replace all other existing numbers to reduce administration
    • The new number format is CHE 123.456.789 MWST starting with CHE to identify it as Swiss number, followed by 9 numbers and MWST. Depending on which part of Switzerland this extension will change as follows:
      • German part: MWST
      • French part: TVA
      • Italian part: IVA

    We recommend you update the VAT Registration No Formats (Administration-> Application Setup -> General -> Countries/Regions) for country CH (Switzerland) with the following entries:

    • CHE#########MWST
    • CHE#########TVA
    • CHE#########IVA
    • CHE ###.###.### MWST
    • CHE ###.###.### TVA
    • CHE ###.###.### IVA

    -Ivan Koletic

  • Microsoft Dynamics NAV Team Blog

    Manage Notes / My Notifications in RTC using a COM Stream Wrapper

    • 2 Comments

    With NAV 2009 it has been made available to the users a messaging system based on Notes / MyNotes page parts. Note records are stored as BLOBs inside table 2000000068 Record Link. It is known that you cannot handle Notes using normal C/AL code and, in particular, correctly stream in and out the content of those BLOB fields.

    In this blog you will find the source code in order to implement a COM Stream Wrapper object to write and read Notes. You may use this COM object to generate and handle Notes when needed without being bound to Notes and MyNotes system part. This object may give you much more flexibility in your RTC code development.

    NOTE: the Stream Wrapper is working correctly (writing) only when code is executed in a RTC based environment. It will give unpredictable and wrong results if executed using Classic Client.

    If you want to know more about Notes you can refer to MSDN link:

    Touring the RoleTailored Client Pages http://msdn.microsoft.com/en-us/library/dd301400.aspx

    My ingredients:

    • NAV 2009 SP1 (with latest HF applied)
    • Visual Studio 2010 Professional
    • VS Command Prompt 2010 (from SDK)
    • Windows 7 Enterprise

    Develop the COM StreamWrapper.dll in Visual Studio

    A. Create a New Class Project

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

     B. Create a Strong Name Key (SNK) and set correct Properties for the Class project

    1. Go to Project > Properties (StreamWrp Properties...)
    2. From the Project Properties form go to "Application*" tab
    3. Enable on Resources, the "Icon and Manifest" option
    4. Click on "Assembly Information" button
    5. In the "Assembly Information" form use the following GUID (or create brand new one):
      • 74f87d09-198a-4d81-a056-53271f21d4dd
    6. In the "Assembly Information" form check "Make assembly COM-Visible" and click OK
    7. From the Project Properties form go to the "Build" tab
    8. In the "General" section tick "Define DEBUG content", "Define TRACE content" and "Allow unsafe code"
    9. From the Project Properties form go to the "Signing" tab
    10. Tick "Sign the assembly"
    11. Create a new Strong Name Key (SNK) e.g. SWtest.snk

    C. Develop (add code to) your StreamWrp project

    1. Add References (replace the existing ones) to the following Namespaces
      • System
      • System.Data
      • System.XML
    2. Locate your Class1.cs file in the Solution Explorer
    3. Right click > View Designer (Shift+F7)
    4. Replace the C# code automatically written with the one written below

    // Copyright © Microsoft Corporation. All Rights Reserved.

    // This code released under the terms of the

    // Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

    using System;

    using System.IO;

    using System.Collections.Generic;

    using System.Text;

    using System.Runtime.InteropServices;

    using System.Runtime.InteropServices.ComTypes;

     

    namespace StreamWrp

    {

        [ComVisible(true)]

        [Guid("2F870D88-FEA5-4F27-81FB-6775D7436E52")]

        public interface IStreamHelper

        {

            string Text

            {

                get;

                set;

            }

            int Transform(int encodeRead, int encodeWrite, IStream reader, IStream writter);

        }

        [ClassInterface(ClassInterfaceType.None)]

        [Guid("B4E5F8F4-5225-4B3A-998A-B82A8A7C6B8E")]

        public class StreamHelper : IStreamHelper

        {

            public string Text

            {

                get

                {

                    throw new Exception("The method or operation is not implemented.");

                }

                set

                {

                    throw new Exception("The method or operation is not implemented.");

                }

            }

            public int Transform(int encodeRead, int encodeWrite, IStream reader, IStream writter)

            {

                byte[] pv = new byte[4098];

                int read = 0;

                unsafe

                {

                    IntPtr pcbRead = new IntPtr(&read);

                    reader.Read(pv, pv.Length, pcbRead);

                }

                MemoryStream innerStream = new MemoryStream(pv, 0, read);

                string note = String.Empty;

                if (innerStream.Length != 0)

                {

                    //Select InS encoding and ReadChars Ins

                    Encoding inEncode;

                    if (encodeRead != 0)

                    {

                        inEncode = Encoding.GetEncoding(encodeRead);

                        using (BinaryReader innerreader = new BinaryReader(innerStream, inEncode))

                        {

                            note = new string(innerreader.ReadChars((int)innerStream.Length));

                            innerreader.Close();

                        }

                    }

                    else

                    {

                        using (BinaryReader innerreader = new BinaryReader(innerStream))

                        {

                            note = new string(innerreader.ReadChars((int)innerStream.Length));

                            innerreader.Close();

                        }

                    }

                    MemoryStream stream2 = new MemoryStream();

                    //Select OutS Encoding and Write OutS

                    Encoding outEncode;

                    if (encodeWrite != 0)

                    {

                        outEncode = Encoding.GetEncoding(encodeWrite);

                        using (BinaryWriter writer = new BinaryWriter(stream2, outEncode))

                        {

                            writer.Write((string)note);

                            writer.Close();

                            pv = stream2.ToArray();

                        }

                    }

                    else

                    {

                        using (BinaryWriter writer = new BinaryWriter(stream2))

                        {

                            writer.Write((string)note);

                            writer.Close();

                            pv = stream2.ToArray();

                        }

                    }

                    unsafe

                    {

                        IntPtr pcbWrite = new IntPtr(&read);

                        writter.Write(pv, pv.Length, pcbWrite);

                    }

                }

                return read;

            }    

        }

    }

    D. Strong sign and build your COM object

    1. Now it is all set up, you are ready to build your StreamWrapper COM object. In the main menu, go to "Build" > "Build StreamWrp F6" (this is automatically strong signed as per properties setting).
    2. NOTE : a WARNING message may arise

    Warning               1              Type library exporter warning processing 'StreamWrp.IStreamHelper.Transform(reader), StreamWrp'. Warning: Type library exporter could not find the type library for 'System.Runtime.InteropServices.ComTypes.IStream'.  IUnknown was substituted for the interface.     StreamWrp

    This is just a Warning about a substitution from IStream to IUnknown. There is no problem with this warning message. The compilation is successful.

     

    E. Place DLLs into a folder and Register them

    1. Locate/Copypaste StreamWrp.dll and StreamWrp.tlb (should be in your \StreamWrp\StreamWrp\bin\Debug folder) in the Add-In folder of a machine where Role Tailored Client has been installed. (typically C:\Program Files\Microsoft Dynamics NAV\60\RoleTailored Client\Add-ins)
    2. Launch the Visual Studio Command Prompt (VSCP) with elevated privilege (Run As Administrator).
    3. In the VSCP, navigate through the location where you have located the dlls. (typically C:\Program Files\Microsoft Dynamics NAV\60\RoleTailored Client\Add-ins)
    4. Once you are located in the right directory type:

    regasm /tlb:StreamWrp StreamWrp.dll /codebase

    (hit return)

    NOTE: there can be some warning messages

    (type)

    gacutil /I StreamWrp.dll

    (hit return)

    Develop the C/AL code

    A. Develop the C/AL code to WRITE and READ Notes in RTC environments

    How this COM Wrapper works? It accepts a Stream and returns a modified Stream. Nothing more.

    It needs to be feed up with 2 encoding values depending if the Wrapper is used to write or read Notes.

    A useful example of encoding (overall if there are special characters that need to be handled, e.g. double S, umlaut, etc.) can be found at this link:

    http://msdn.microsoft.com/en-us/library/system.text.encoding.windowscodepage.aspx

    In this example, I am using a DEU standard database, therefore I am using IBM437 CodePage to correctly encode/decode the stream (note that IBM437 is also part of the Windows CodePage 1252).

    The 2 following Codeunits attached in TXT format are used to Write and Read Notes.

    NOTE: in order to let this example works you must have, at least, 1 note created from RTC (it merely use a copy from the last record, just as example).

    This is the C/AL code snippet to WRITE Notes using RTC

    ...

    // Copyright © Microsoft Corporation. All Rights Reserved.

    // This code released under the terms of the

    // Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

    IF ISSERVICETIER THEN BEGIN

    CLEAR(NoteText);

    // Add special chars

    NoteText.ADDTEXT(STRSUBSTNO(Text1000000001,USERID,TODAY,TIME) + ' - ìèòàù - Österreich - ');

    // Browse country table and create the Note by pasting Code and Name into the NoteText

    CountryRec.RESET;

    IF CountryRec.FINDFIRST THEN REPEAT

      NoteText.ADDTEXT(' ** Country ' + FORMAT(CountryRec.Code)+ ' - ' + FORMAT(CountryRec.Name));

    UNTIL CountryRec.NEXT = 0;

    // Find the last Record Link to retrieve the ID

    RecordLink.RESET;

    RecordLink.FINDLAST;

    LinkID := RecordLink."Link ID"; 

    // Create ID+1 Record Link with empty Note (copy the link above)

    LinkID := LinkID + 1;

    RecordLink2.INIT;

    RecordLink2."Link ID" := LinkID;

    RecordLink2."Record ID" := RecordLink."Record ID";

    RecordLink2.URL1 :=RecordLink.URL1;

    RecordLink2.Type := RecordLink2.Type :: Note;

    RecordLink2.Created := CURRENTDATETIME;

    RecordLink2."User ID" := USERID;

    RecordLink2.Company := COMPANYNAME;

    RecordLink2.Notify := TRUE;

    // Stream the NoteText inside the note

    RecordLink2.CALCFIELDS(Note);

    RecordLink2.Note.CREATEOUTSTREAM(OutS);

    NoteText.WRITE(OutS);

    RecordLink2."To User ID" := USERID; 

    RecordLink2.INSERT;

    // Find the record inserted in order to 'adjust' it with the StreamWrapper

    RecordLink2.INIT;

    RecordLink2."Link ID" := LinkID;

    RecordLink2.FIND('=');

    RecordLink2.CALCFIELDS(Note);

    RecordLink2.Note.CREATEINSTREAM(InS); 

    RecordLink2.Note.CREATEOUTSTREAM(OutS);

    // Let the COM StreamWrapper transform the Blob correctly

    EncodeIn := 437;  //CodePage IBM437

    EncodeOut := 0;   //No CodePage in output

    IF ISCLEAR(Transform) THEN

      CREATE(Transform);

    InSVar := InS;

    OutSVar := OutS;

    Transform.Transform(EncodeIn, EncodeOut, InSVar, OutSVar);

    RecordLink2.MODIFY();

    END; 

    MESSAGE('WRITE : DONE');

    ...

    And this is the C/AL code snippet to READ Notes using RTC

    ...

    IF ISSERVICETIER THEN BEGIN

      CLEAR(TempBlobRec);

      CLEAR(NoteText);

      // Find the right Record Link

      RecordLink.RESET;

      RecordLink.FINDLAST;

      IF RecordLink.Note.HASVALUE THEN BEGIN

        RecordLink.CALCFIELDS(Note);

        RecordLink.Note.CREATEINSTREAM(InS);   //Note --> InS

        // Init a Temp Blob

        IF TempBlobRec.GET(10000) THEN

          TempBlobRec.DELETE;

        TempBlobRec.INIT;

        TempBlobRec."Primay Key" := 10000;

        TempBlobRec.INSERT;

        // Stream the 'modified back' Note onto this Blob field

        TempBlobRec.GET(10000);

        TempBlobRec.CALCFIELDS(Blob);

        TempBlobRec.Blob.CREATEOUTSTREAM(OutS);

        // Let the COM StreamWrapper transform the Blob correctly

        EncodeIn := 0;    // Read raw data from BLOB

        EncodeOut := 437;   // Use CodePage IBM437 in output

        IF ISCLEAR(Transform) THEN

          CREATE(Transform);

        InSVar := InS;

        OutSVar := OutS;

        Transform.Transform(EncodeIn, EncodeOut, InSVar, OutSVar);

        TempBlobRec.MODIFY; 

        // Get the modified Blob rec and read it

        TempBlobRec.GET(10000);

        TempBlobRec.CALCFIELDS(Blob);

        TempBlobRec.Blob.CREATEINSTREAM(InS2);

        // Algorithm to READ the Blob output

        IsFirstTxtLine := TRUE;

        WHILE NOT (InS2.EOS()) DO BEGIN

          Int:= InS2.READ(Txt);

          IF Int <> 0 THEN BEGIN

            IF IsFirstTxtLine THEN BEGIN

              LengthStr := STRLEN(Txt);

              CASE LengthStr OF

                1..126 : Txt := COPYSTR(Txt,3,STRLEN(Txt));

                127 : Txt := COPYSTR(Txt,4,STRLEN(Txt));

                ELSE

                  Txt := COPYSTR(Txt,5,STRLEN(Txt));

              END;

              IsFirstTxtLine := FALSE;

            END;

            MESSAGE(Txt);

          END;

          CLEAR(Txt);

          CLEAR(Int);

        END;

      END; 

    END;

    MESSAGE('READ - DONE');

    ...

    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

    A special thanks to Jorge Alberto Torres - DK-MBS NAV Development

  • Microsoft Dynamics NAV Team Blog

    Microsoft Dynamics NAV 2009 R2 Ships!

    • 7 Comments

    This seems to be a good time of year for me to blog. When I do, I get to announce a new release of Dynamics NAV, and what could be more fun for someone in R & D? So I'm here again to tell you we shipped another version, this time Microsoft Dynamics NAV 2009 R2!

    Last year, I had these philosophical thoughts to open the dialog:

    "Microsoft Dynamics NAV 2009 was a release of courage. We made big bets. We wanted nothing short of transformation. And we accomplished our goal, shipping what is arguably the most significant release in Microsoft Dynamics NAV history.

    Microsoft Dynamics NAV 2009 SP1, by contrast, is a release of precision. We listened and collaborated with you, our partners and customers. We refined. We executed predictably. And, less than 12 months after the release of Microsoft Dynamics NAV 2009, we are giving you a service pack that extends the value of Microsoft Dynamics NAV 2009 and meets our joint goal of making Microsoft Dynamics NAV simply the most productive middle-market ERP product on the planet. In this way, it is just as big as the release it is built upon."

    If Microsoft Dynamics NAV 2009 was a release of courage and NAV 2009 SP1 was a release of precision, NAV 2009 R2 is a release of agility. Because of architectural investments we made in NAV 2009 and based on your increasing interest in hosting and the cloud, we were able to pull features together early and ship them to you now. Getting you value earlier and more often is something we will continue in the future, based on a more frequent release cadence. (The fact that we've shipped three versions of NAV in the past three years is indicative.)

    Since RTM blogs should have an element of the retrospective (in addition to evangelism), let's rewind a bit to spring of this year. At that time, several things happened. First, we had done some investigations about running the RoleTailored client over wide-area networks, which would dramatically improve the usability of a hosted solution while reducing its cost. Second, we realized that many of the features we'd already done in NAV "7" could be shipped early. Finally, by working with the CRM Integration team in Microsoft, we both agreed that we wanted to get the CRM-to-NAV Connector out early. Thus, R2 was born. It was announced soon thereafter at Directions EMEA in May. Quickly, we got the release feature set together, spun off the appropriate people, and moved forward. Several clever Program Managers managed to get in additional features, such as Win 7 light-up integration, online payments, filtering ability on subpages, and .NET Interop.  (This very cool last feature is also predicated on the architectural changes from NAV 2009...)

    But we had a problem.

    We were due to ship NAV 2009 SP1 in several countries in Central and Eastern Europe by the end of the year. We didn't know how we could handle another version of NAV and ship NAV 2009 SP1 to those countries that still hadn't received it. In retrospect, the answer was obvious, despite it being a course through uncharted waters: let's ship it in all the countries at the same time. So, for the first time, we give you a release of NAV in 42 countries simultaneously!

    As much as I'd like to tell you about all the great value in this release (and how partners clapped for Michael Nielsen when he showed them the new database indicator feature), my team does that much better than I. They've already provided for you a set of excellent blogs on the topic.

    Download a copy of Microsoft Dynamics NAV 2009 R2 on PartnerSource or CustomerSource and let us know what you think!

    Once again, thanks to all the customers and partners who've worked with us on this release, giving us continuous feedback about what we should work on. We hope you enjoy NAV 2009 R2 as much as we enjoyed building it. Finally, thanks to all the people at Microsoft working their butts off on Microsoft Dynamics NAV to deliver this release to you. A greater group of passionate folks I have not met!

    -Dan
    General Manager, Microsoft Dynamics NAV

  • Microsoft Dynamics NAV Team Blog

    Using XBRL to Submit Balance Sheet and Profit and Loss Statement Electronically in Germany

    • 6 Comments

    We are already close to year end and this most of the time is the period with a lot of changes in law / tax.

    I would like to inform you that there is an upcoming legal requirement for Germany.

    The new law (in Germany) is about submitting the annual statements (like balance sheet and profit & loss etc.) electronically. This is called eBillanz in German. For this electronic submission, the government decided to use XBRL technology. The first intention from authorities was to make this mandatory for years which start after 31.12.2010. But this has been changed now.

    There has been a decision that the new requirement will be delayed for one year. This means the first year to be reported electronically now is the year that starts after 31.12.2011. Nevertheless companies already can use the electronic submission as the time until the requirements starts is being seen as test period.

    The German government decided to have a direct submission from the ERP-Systems or any other bookkeeping systems to their server (similar to ELSTER). So far, no alternate solution like uploading the XBRL XML file on the ELSTER Portal is being considered. 

    The creators of the taxonomy have introduced yet another change: instead of declaring name spaces in the header of the XML document, they have chosen to also declare name spaces in sub-nodes. This is of course legal XML and hence we cannot complain. It would be super to have the XBRL community agree on similar (future) patterns.

    From our perspective we have this requirement on our radar and currently we are investigating the possible solutions. Next to Germany, there is also UK and Estonia with such a requirement. UK will use iXBRL and will start by the 1st of April, 2011.

    We are interested in getting more information about the current process, what and how companies are doing today to submit the annual statement to the tax authorities, and especially, which tool they use to submit the reports to the authorities, i.e. German Bundesanzeiger.

    -Ivan Koletic

  • Microsoft Dynamics NAV Team Blog

    Let NAV Speak! (with .NET Interop and NAV 2009 R2)

    • 8 Comments

    In this blog is described a very simple usage of the .NET interoperability feature with Microsoft Dynamics NAV 2009 R2 and can be considered an extension of my previous blog: http://blogs.msdn.com/b/nav/archive/2010/07/09/let-nav-speak-with-a-simple-and-useful-client-add-in.aspx.

    It is intended just to familiarize you with this brand new feature proposed with the NAV 2009 R2 release.

    If you want to know more about .NET interoperability for NAV 2009 R2, please refer to MSDN link:

    Extending Microsoft Dynamics NAV Using Microsoft .NET Framework Interoperability

    http://msdn.microsoft.com/en-us/library/gg502499.aspx

    The .NET interoperability code snippet in this blog is based on the System.Speech namespace.

    http://msdn.microsoft.com/en-us/library/ms554861(v=VS.90).aspx

    My ingredients:

    • NAV 2009 R2
    • Windows 7 Enterprise

    Create your "Speak it!" action and let NAV speak Customer Names :

    1. Open Classic Client

    2. Go to the Object Designer

    3. Select Page object (alt+g)

    4. Select Page 22 "Customer List"

    5. Design Page 22 "Customer List" (alt+d)

    6. Select View > Page Actions (al+v, o)

    7. Create a new Action (F3) in the ActionItems container (see below)

    8. Change the properties of the Action as below:

    Caption - Speak it !

    Image - ViewComments

    Promoted - Yes

    PromotedCategory - Process

    PromotedIsBig - Yes

    9. Edit the code in the Speak it! Action (F9)

    10. Add those LOCAL variables

    dnSpeech

    DataType: DotNet

    Subtype: System.Speech, Version=3.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35.System.Speech.Synthesis.SpeechSynthesizer

    RUNONCLIENT: Yes
    Synth

    DataType: DotNet

    Subtype: System.Speech, Version=3.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35.System.Speech.Synthesis.SpeechSynthesizer

    RUNONCLIENT: Yes

    dnVoiceGender

    DataType: DotNet

    Subtype: System.Speech, Version=3.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35.System.Speech.Synthesis.VoiceGender

    RUNONCLIENT: Yes

    I

    DataType: Integer

     

    NOTE: RUNONCLIENT is a property of each DotNet variable (shift+f4)

    11. Add this code snippet in the OnAction trigger

    ...

    // Copyright © Microsoft Corporation. All Rights Reserved.

    // This code released under the terms of the

    // Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

    // Use the constructor to create a new Synthesizer

    Synth := dnSpeech.SpeechSynthesizer();

    // http://msdn.microsoft.com/en-us/library/system.speech.synthesis.voicegender(VS.90).aspx

    // This is an enumeration assignment:

    // 0=NotSet,1=Male,2=Female,3=Netural

    dnVoiceGender := 2; //Female

    // NOTE: it will take the voice depending on what is

    //  installed locally (e.g. Windows 7 has Microsoft Anne voice)

    Synth.SelectVoiceByHints(dnVoiceGender);

    // Please, speak slowly (range [-10:10])

    Synth.Rate := -3;

    Synth.SetOutputToDefaultAudioDevice();

    Synth.Speak(FORMAT(Name));

    // Row below is not needed. Synth is a local variable therefore it will be

    // automatically disposed

    // Synth.Dispose;

    ...

    12. Save and compile (ctrl+s) page 22 "Customer List"

    Now... you are ready to let NAV speech the Customer Name from the customer list by simply click on the "Speak it!" action.

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

    Best Regards,

    Duilio Tacconi (dtacconi)

    Microsoft Dynamics Italy

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    NAV 2009 Tips and Tricks: Send lists and cards to Microsoft Word, Excel, and Outlook

    • 3 Comments

    It's easy to share Microsoft Dynamics NAV information with colleagues who do not have access to the application. You can export the information from Microsoft Dynamics NAV to Word, Excel, or Outlook, and share the document. The information you export retains the formatting of the Microsoft Dynamics NAV document. From there, you can share the document as is, or make edits to customize it.

    In the following example, you see how to export a list to Word, Excel, and Outlook.

    1. Open a list, in this example, the Customers list.

    2. Click Actions , click Send To, and then click one of three options:

    a. Outlook: Click Recipient as Attachment. Microsoft Outlook opens and the list is attached as an html document.

    If you open the attachment, the html file looks like this:

    Address the email, and click Send.

    b. Word: Click Microsoft Word. The list opens in Microsoft Word. After you save it, you can share it with your colleagues, who now have access to your Microsoft Dynamics NAV information even if they do not have access to the application.

    The Word document looks like this:

    c. Excel: Click Microsoft Excel. The list opens in Microsoft Excel.

    The Excel document looks like this:

    In the example, you have seen how to share your Microsoft Dynamics NAV lists. You can use the same technique to share information from individual cards (records). The same menu options are available to you on cards of all types.

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

  • Microsoft Dynamics NAV Team Blog

    Preventing the Winmail.dat when not using Outlook as the default mail client

    • 0 Comments

    This is one of those scenario’s that is very difficult to troubleshoot because many external components are involved or could be involved like Dynamics NAV, Outlook, an ISP’s mail server, an internal or hosted Exchange Server, different webmail clients, Outlook Express and of course third party mail clients. Partners, end customers and Microsoft do not control all these components. Last but not least, there appears to be a difference in behavior when CU397 is being modified to directly send the message without having the E-mail message composed in Outlook first. Still, the receiver does not like to receive an E-mail with an attachment called Winmail.dat. Especially if it is an important PDF file or DOCX file containing an invoice or Sales Order. Here is however what we can say about this issue and what you can do about it.

    When a Microsoft Exchange 20xx Server user sends a Simple Mail Transfer Protocol (SMTP) e-mail message with an attachment to a mail-enabled contact in the Global Address List, the mail-enabled contact may receive a Winmail.dat file attachment with the e-mail message instead of receiving the correct file attachment.

    This issue may occur if the following conditions are true for the mail-enabled object on the Exchange computer:
    • The default message format is set to Rich Text Format (RTF).
    • The MAPI Recipient attribute is missing, is set to null, or is set to true.

    Note The previous typically occurs if the mail-enabled contact is added by using a script.

    You could change the settings in Active Directory Users and Computers so that the mail-enabled contact does not use RTF as the default message format. To do this, follow these steps:
    1. Open Active Directory Users and Computers. To do this, click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.
    2. Click the container where the mail-enabled contact is located.
    3. Right-click the mail-enabled contact in the right-pane, and then click Properties.
    4. Click the Exchange Advanced tab, and then click to clear the Use MAPI rich text format check box.
    5. Click Apply, and then click OK.

    The sender can avoid sending TNEF attachments by turning off TNEF in Outlook. When Outlook is configured to send e-mail in "Outlook Rich Text Format", it may use TNEF. When it sends in "HTML" or "Plain Text", it uses standard, compatible formats. There are many webmail clients and third party E-mail clients out there that do not completely support TNEF format:
    How e-mail message formats affect Internet e-mail messages in Outlook
    http://support.microsoft.com/kb/290809

    This has to be done for every user, who sends the mentioned important mails.

    We have also seen cases where we use CU397 to send emails with attachments. For a particular group of recipients using a third party SMTP server, the attachments are being received as Winmail.dat if and only if the email was opened after it was created by CU397 (OpenDialog parameter of NewMessage function is set to TRUE). Sending the email without any user interaction (OpenDialog parameter of NewMessage function is set to FALSE) does not exhibit this behavior. Creating a new E-mail through Outlook's GUI also does not exhibit the behavior. This behavior is also not seen if the mail server of both sender and receiver is an Exchange Server.

    You could also try changing the BodyFormat property in CU397 to plain text:

    OSendMail.BodyFormat := 2 - creates HTML formatted e-mail 
    OSendMail.BodyFormat := 1 - simply text

    Unfortunately, there are still scenario’s where this all did not lead to a scenario where the receiver does receive the attachment correctly. The following could lead to a final resolution, but some care needs to be taken into account if you are also running E-mail logging as a process. To resolve the issue, please adjust the following code in CU397:

    Old Code:

    OSendMail."To" := ToName;
    OSendMail.CC := CCName;
    OSendMail.Subject := Subject;
    OSendMail.BodyFormat := 2;
    MailGUIDValue := CREATEGUID;
    OSendMail.SetUserProperty(GetMailGUIDFieldName,1,FORMAT(MailGUIDValue));

    New Code:

    OSendMail."To" := ToName;
    OSendMail.CC := CCName;
    OSendMail.Subject := Subject;
    OSendMail.BodyFormat := 2;
    // MailGUIDValue := CREATEGUID;
    // OSendMail.SetUserProperty(GetMailGUIDFieldName,1,FORMAT(MailGUIDValue));

    If the following is true, then please have a look at the following:

    1. the end customer uses Dynamics NAV and sends out an E-mail using a slightly modified CU397 where OpenDialog parameter of NewMessage function is set to TRUE
    2. the end customer uses Dynamics NAV with E-mail logging enabled

    Removing the MailGuidValue will cause multiple interaction log entries to be created when using e-mail logging. 
    The MailGuidValue property is only used by e-mail logging to recognize mails as a part of an existing interaction log entry.  .

    Then, if you don’t use the email logging, removing it will have no significant/catastrophic effect.

    Development has confirmed they are looking at the E-mail logging functionality for version 7; especially since Outlook 2010 does not support CDO anymore:
    http://blogs.msdn.com/b/deva/archive/2010/01/19/outlook-2010-why-cdo-1-2-1-not-supported-with-outlook-2010.aspx

    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: Navigate between Pages

    • 0 Comments

    When you are in your Role Center, you can use navigation buttons, forward and back, to help you navigate between pages.

    The navigation buttons are at the top of your Role Center, in the left-hand corner. Next to them is the Address bar, which displays the location of the current page within the navigation hierarchy of the application. In the following illustration, you can see that the Back button is highlighted, and the address is the Home page of the Role Center.

    In this illustration of a Sales Manager role center, you can select the Items list, and then select Sales Orders. You can use the Forward and Back buttons to go back and forth between the two lists.

    1. In the navigation pane, select Items.

    2. Next, in the navigation pane, select Sales Orders.

    3. Click the Back button. Notice that the tooltip displays the text "Back to Items."

    4. Pause on the Forward button. Notice that the tooltip displays the text "Forward to Sales Orders."

    5. Click the drop-down button to the right of the Forward button to see your entire Travel history of recently visited pages.

  • Microsoft Dynamics NAV Team Blog

    Creating new entities for the Outlook Synchronization solution results in empty synchronized entries

    • 0 Comments

    After setting up a new synchronization entity in Dynamics NAV 2009 SP1 to synchronize a specific Dynamics NAV table to Microsoft Outlook, the result of the first synchronization is that empty records are being created. E.g.:

    image

    The reason for this is that table 5304, field 15, contains a Read-Only Status field set to Read-Only in Outlook:

    image

    These fields are not synchronized because they are marked as Read-Only in Outlook. This property is retrieved from MAPI for each field. The default entities are generated via CU5300 where the fields are inserted via code. As a work around we suggest one of these 2 options:

    1) remove the validation in COD5300 in ValidateOItemPropertyName trigger

    [BEFORE]

    IF TempOSynchLookupName.FINDFIRST THEN BEGIN
      InputString := TempOSynchLookupName.Name;
      OPropertyInfo := OObjInfo.GetProperty(TempOSynchLookupName."Entry No.");
      IsReadOnly := OPropertyInfo.IsReadOnly;
      EXIT(TRUE);
    END;

    [AFTER]

    IF TempOSynchLookupName.FINDFIRST THEN BEGIN
      InputString := TempOSynchLookupName.Name;
      OPropertyInfo := OObjInfo.GetProperty(TempOSynchLookupName."Entry No.");
      //IsReadOnly := OPropertyInfo.IsReadOnly;
      EXIT(TRUE);
    END;

    2) Add default customization through code, the same as it is done for the default entries APP, CONT_SP, etc.

    For instance, please do have a look at COD5300 triggers :

    CreateDefaultContPers
    CreateDefaultContComp
    CreateDefaultContSp
    CreateDefaultTask
    CreateDefaultApp

    Lines like the below one are used for inserting the fields in table 5304:

    InsertOSynchField(OSynchEntity.Code,0,OSynchEntity."Table No.",OSynchEntity."Outlook Item",'BusinnessAddress',
      FALSE,FALSE,0,2,'',0);

    NOTE: any entities created before this code adjustment will have to be recreated.

    This issue does not occur in Dynamics NAV 5.0 SP1.

    Regards,

    Marco Mels
    CSS EMEA

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

Page 1 of 1 (9 items)