mfp's two cents

...on Dynamics AX Development!
  • mfp's two cents

    Cryptography API in X++

    • 4 Comments

    In version 3.0 the class TextBuffer had two methods: Encrypt and Decrypt. For version 4.0 the Encrypt method has been removed, and the Decrypt method renamed to DecryptOld.

    The change happened for security reasons.

    If you require to encrypt and decrypt strings in Dynamics AX 4.0, you can use the functionality provided in the .Net System.Security.Cryptography namespace.

    By doing so, you should be aware of the dangers, including:

    • A key is required to do encryption and decryption. Your encrypted data is never more secure than the key - so avoid storing the key (including hard coding it in X++) instead prompt the user for the key.
    • Use the Encryption algorithm as it is intended. Do not double-encrypt, it may make it easier to break the code.

    To help you get going, I've created an X++ Cryptography class. It uses the implementation of the encryption algorithm Rijndael from .Net. The class is attached to this thread.

    Here is an example on how to use it:

    static void main(Args _args)
    {
        Dialog dialog = new Dialog("Cryptography Demo");
        DialogField dfText = dialog.addField(typeid(description), "Text to encrypt");
        DialogField dfKey  = dialog.addField(typeid(description), "Key to encrypt with");
        str encryptedString;
        str decryptedString;    
        if (dialog.run())
        {
            encryptedString = Cryptography::Encrypt(dfText.value(), dfKey.value());
            decryptedString = Cryptography::Decrypt(encryptedString, dfKey.value());        
            info(strfmt("Encrypted string: %1", encryptedString));
            info(strfmt("Decrypted string: %1", decryptedString));
        }

    A big thank you to Ivan Medvedev for providing the C# implementation that I rewrote to X++. You can find the original article here - including more security considerations: http://www.dotnetthis.com/Articles/Crypto.htm 

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

  • mfp's two cents

    Setting up Visual Source Safe and Dynamics AX 4.0

    • 1 Comments

    Yurii Rasskazov has written a great blog on his experience setting up VSS with Dynamics AX. Here it is:

    http://axaptabuilder.blogspot.com/2006/06/notes-about-my-experience-in-setup-of.html

    For more information on the version control system in Dynamics AX see the topics in the Microsoft Dynamics AX SDK under Microsoft Dynamics AX Programming Environment / MorphX Development Tools / Version Control System.

  • mfp's two cents

    Writing Secure X++ Code

    • 0 Comments

    Last week a document on security considerations for Dynamics AX development was published.This 40 page document is a must-read for every X++ developer.

    Topics covered:

    • How to use dangerous APIs in a safe manner
    • Code Access Security in X++
    • Data Authorization
    • Credentials and Cryptography
    • Server-side batch processing
    • New best practice rules
      (Those prefixed with "TwC" - you might already have seen them)

    The document is available here:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=5e050494-1613-4b3a-9363-d69d60c56877&DisplayLang=en

  • mfp's two cents

    An amazing journey!

    • 0 Comments

    This week I'm visiting IDC - Microsoft's India Development Center located in Hyderabad - to conduct training on Dynamics AX development. Sitting on the back seat of a cab zig-zagging through the busy traffic in downtown Hyderabad I can't help thinking back on my very first Axapta (That was the product name back then) presentation. I did this presenation at DTB in London 1999, and it attracted 3 curious people wanting to learn about the intricacies of MorphX and X++. Now, a few years and thousands of miles later, I'm covering more-or-less the same material for a room packed with eager developers in India.

    Traveling so far, and meeting with so many talented people, helped me understand something the many success-story memos and status reports couldn't. I'm left humble and deeply touched. Dynamics AX is on an amazing journey. And it is just getting started... 

  • mfp's two cents

    I want developer documentation!

    • 0 Comments

    The solution is here!

    The developer documentation for Dynamics AX has moved to a continuing publishing model. This means more and more documentation topics will be available as they are written, and not as previously only when a new version is released.

    However, despite good intentions, the developer documentation released with Dynamics AX currently primarily contains the boiler-plate: "At the time of publication, no information was available for this topic." This even happens for topics that were documented in previous versions.

    The documentation teams at Microsoft have work hard on verifying, proof reading and moving topics into the Html help. Only topics they have signed off are available in the Dynamics AX 4.0 RTM.

    If you, like me, prefer less-accurate information to no-information, the solution is here.

    Attached is an xpo-file, that when imported, will tweak the help system's behavior: If a help topic actually is available in the Html Help it will be displayed, just like the normal behavior. However, if a topic in Html Help just contains the boiler-plate message, then the legacy help system will take over, and display the topic from the legacy system.

    This provides three benefits:

    • Even when no help is in the legacy help system, auto-generated help will be displayed, including quick access to Application Hierarchy Tree and Cross-reference information.
    • This unlocks a lot of new help topics, that was written by developers, but hasn't yet been moved into Html Help.
    • When new topics are published through the continuing publishing model, they take precedence over legacy topics.

    The downsides are:

    • The help topics you see in the legacy help system have not been scrubbed, and thus the quality may vary.
    • The help system is slowed down a little bit, as the Html Help topic must be examined before displaying any help.
    • When the two help systems will live side-by-side, the user experience leaves some to desire. For example, the COM class's documentation shows up in Html Help, whereas the new method on the COM class is displayed in the legacy help system.
    • Links from Html Help to the legacy help is not supported. (The other direction is).

    [Update: The attached solution now also supports the 4.0 SP1 help]
    [Update2: The attached solution now also supports incorrectly mapped topics ]

    This post is provided "AS-IS" with no warranties, and confers no rights.

Page 1 of 1 (5 items)

July, 2006

mfp's two cents

...on Dynamics AX Development!