Sunday, 20 December 2015

How to get AX 7 Technical Preview VM

Couple of days ago "Microsoft Dynamics AX" public preview went live. @satishthomas from Microsoft blogged more info on this (link). In summary following needs to be done to get it going

1. For customer source use this link  and for partner source use this link.
2. Login using either customer or partner source credentials.
3. Once logged in scroll down and you'll see a small paragraph as shown below


Clicking on the highlighted part will get you going on signing up for the preview. More details on these steps can be found on Satish's blog.

However if you want to get a VM to run it locally, you'll have to take some additional steps. Once you have signed up for the preview, come back to the sign up page on customer/partner source and scroll further down in the FAQ section and find the feedback question as shown below.


Clicking on the link will take you to Connect site where you'll be automatically added to preview program. There you'll see a download section as shown below

The download section will contain the link to download the preview VM



This posting is provided "AS IS" with no warranties. Use code at your own risk.

Friday, 18 December 2015

AX 7 Help Wiki available

Help wiki is now available for technical preview of new "Microsoft Dynamics AX" aka AX 7. It can be accessed from the following link

https://ax.help.dynamics.com/en/

The wiki details how to sign up for AX 7, get an instance running either in cloud or get a vhd to run locally, technical changes and a lot more.

This posting is provided "AS IS" with no warranties. Use code at your own risk.

Friday, 17 April 2015

Caching display methods

A display method is usually used to fetch data from another source or to perform calculations. It is recommended to create them on Tables. Once these display methods are used on forms, these are called every time the form is re-drawn. However if the field/group/tab which uses this method is hidden the display method is not called. For performance reasons the display method should be cached. This way system calls the method once and stores its values reducing unnecessary calls to server.

Recently we had a performance issue and on investigation found out that apart from the actual cause of problem, some display methods are not cached. So we followed the recommendations and cached the methods using attribute [SysClientCacheDataMethodAttribute(true)].

Every thing was fine until a user complained about performance using a specific customer. We investigated again and found out that one of the display method that we cached in previous findings is causing the issue. It had a IF condition and was doing some heavy calculation in certain cases only. But why this was not a problem before. On further investigation we found that the field on form which was using this display method was hidden. So when the display method was not cached it was not called by system.

However after caching it, upon opening of the form, system was calling the following method
<Table Name>::executeCachedDisplayMethods
This method was calling all the cached display methods of the table regardless of whether the field for the display method is hidden or not. This behavior is different from when the display method is not cached.

Our solution to problem was to remove the hidden field from the form.

This posting is provided "AS IS" with no warranties. Use code at your own risk.

Friday, 3 April 2015

Connect to a desired AOS in load balanced AOSs

If you have a set of clustered AOS and you want to connect a specific AOS, use the following command line parameters
AX32.exe -loadbalance=0 -aos2=<AOS SERVER NAME>:<AOS PORT>
This posting is provided "AS IS" with no warranties. Use code at your own risk.

Monday, 2 March 2015

.NET Cast Type Name not found error

Last week I was trying to fix a bug in custom code where we import the POs. The bug was in the following method.
protected AnyType getData(int _position, Container _data = currentData)
{
    str data = conpeek(_data, _position);
    data = strRem(data,'"');
    
    if( _position == str2int(#13)
     || _position == str2int(#14))
    {
        data = this.formatDate(data);
    }

    return data;
}
The fix for the bug was to check for another position #07 and convert the data to date format. So I changed the code to following
protected AnyType getData(int _position, Container _data = currentData)
{
    str data = conpeek(_data, _position);
    data = strRem(data,'"');
    
    if( _position == str2int(#13)
     || _position == str2int(#14)
     || _position == str2int(#07))
    {
        data = this.formatDate(data);
    }

    return data;
}
Note the position of #07 in the if statement. The compile was fine however when I generated IL it gave the following error. Incremental or full IL, both produced the same error.
CIL generation: Error: .NET Cast Type Name not found. Type System.String found on the stack. This code in Class/Table: POImportService, Method: getData may not work in CIL run time.
I moved the position of #07 as shown below and the error disappeared.
protected AnyType getData(int _position, Container _data = currentData)
{
    str data = conpeek(_data, _position);
    data = strRem(data,'"');
    
    if( _position == str2int(#07)
     || _position == str2int(#13)
     || _position == str2int(#14))
    {
        data = this.formatDate(data);
    }

    return data;
}
Not sure why IL does not like the #07 line to be the last one.

This posting is provided "AS IS" with no warranties. Use code at your own risk.