Pages

Friday, January 29, 2016

pickTable method being painfully slow in AX 2012?

The call to pickTable in a user session can be extremely slow. I have measured times of up to 20 (!) minutes on an otherwise well functioning system.

A trace shows very clearly that the method is very chatty, so wrap the call into a server bound method. And ta-da, what took minutes now takes a second or two.

Wednesday, January 27, 2016

Explore the different form arrangements in AX 7

There is a tutorial form in AX 7 that shows you the different types of form arrangements.

The link to the form is: https://(your AX instance).cloudax.dynamics.com/?f=tutorial_Form_Arrange&cmp=DAT

Tuesday, January 19, 2016

Show the table browser in AX7

I just wanted to share this tip I have picked up from Marc Hugelshofer in a forum.

In your browser you can open the table browser by entering an URL that looks something like this:

https://(the url of your ax instance)/Default.htm?mi=SysTableBrowser&prt=initial&cmp=USMF&tablename=CustGroup&limitednav=true

Thursday, January 7, 2016

Creating code for a dll that might or might not be on the system

We are working on a vertical solution where parts of it requires integration with an external .net dll. Not all customers are interested in using the part that requires the external dll, and thus they are not interested in installing the dll.

So how can we write our code so it will compile and run regardless of this dll being there or not.

Well, one way is to create a proxy class in AX to wrap all operations for the external dll. The proxy class need to call the dll through CLRObjects which makes it possible to compile the code even if the dll is not present. Secondly the proxy class needs to runtime deal with the fact that the dll is not there.

The following job shows how the proxy class could be constructed. The example works with a random standard dll I choose.

static void TestCLR(Args _args)
{
    CLRObject /*Microsoft.Dynamics.AX.Framework.Tools.DMF.CrossInstanceProxy.InstanceProxy*/ dllObject;

    str     nameOK     = 'Microsoft.Dynamics.AX.Framework.Tools.DMF.CrossInstanceProxy.InstanceProxy';
    str     nameNotOK  = 'xMicrosoft.Dynamics.AX.Framework.Tools.DMF.CrossInstanceProxy.InstanceProxy';

    str proxyStr = nameNotOk; // Switch name here to test with the dll being alright and the opposite

    try
    {
        dllObject = new CLRObject(proxyStr);
    }

    catch (Exception::Internal)
    {
        // Clear the info log of CLR errors
        infolog.clear(infologLine() - 2);
       
        // Register that the dll couldn't be instantiated
        print "Could not make an instance of the dll";
    }

    if (dllObject)
    {
        print "Got the object";
    }
    else
    {
        print "No instance";
    }
    pause;
}

It is a pest working against just the CLRObject and not with the direct access you could get if you could be sure that the dll would be there. That's a another reason for wrapping all your calls to the dll into an X++ proxy class.

Monday, December 28, 2015

Working with Excel files in AX7

To work with Excel files from code, Microsoft now suggests using the EPPlus .NET library.

EPPlus 4.04 (http://epplus.codeplex.com) is available to X++ via AOT/References/EPPlus.

There is an example of usage in AOT/Code/Classes/CustCollectionsExcelStatement.

Monday, December 21, 2015

Changes to X++ in AX7

Michael Fruergaard Pontoppidan is running a great series of blog articles about changes to X++ in AX7.

You really shouldn't miss it. The blog is located here: http://blogs.msdn.com/b/mfp/

Friday, December 18, 2015

Public Preview of the new Microsoft Dynamics AX is now available on PartnerSource and CustomerSource

Now access is open for public preview of the new great Microsoft Dynamics AX.

Here are the links for PartnerSource and CustomerSource.

PartnerSource links:
https://mbs.microsoft.com/partnersource/northamerica/news-ev…
https://mbs.microsoft.com/partnersource/global/news-events/n…
https://mbs.microsoft.com/partnersource/australia/news-event…
https://mbs.microsoft.com/partnersource/latinamerica/news-ev…
https://mbs.microsoft.com/partnersource/uk/news-events/news/…
https://mbs.microsoft.com/partnersource/france/news-events/n…
https://mbs.microsoft.com/partnersource/germany/news-events/…
https://mbs.microsoft.com/partnersource/denmark/news-events/…
https://mbs.microsoft.com/partnersource/spain/news-events/ne…


CustomerSource links:
https://mbs.microsoft.com/customersource/northamerica/AX/new…
https://mbs.microsoft.com/customersource/global/AX/news-even…
https://mbs.microsoft.com/customersource/australia/AX/news-e…
https://mbs.microsoft.com/customersource/latinamerica/AX/new…
https://mbs.microsoft.com/customersource/uk/AX/news-events/n…
https://mbs.microsoft.com/customersource/france/AX/news-even…
https://mbs.microsoft.com/customersource/germany/AX/news-eve…
https://mbs.microsoft.com/customersource/denmark/AX/news-eve…
https://mbs.microsoft.com/customersource/spain/AX/news-event…