Wednesday, May 16, 2012

Dynamics AX EP timeout issue

Sometime for debugging or traversing large data in EP causing an issue of timeout, we can increase the timeout by setting the AsyncPostBackTimeout for AJAX which was causing the timeout. Here is the code which we can write in Page_Load event:

protected void Page_Load(object sender, EventArgs e)
{
    ScriptManager scripts = ScriptManager.GetCurrent(this.Page);

   if (scripts != null)
    {
        scripts.AsyncPostBackTimeout = 800; // 800 seconds
    }

}

Monday, May 14, 2012

Changing the language at runtime in X++

During searching the same task, I found follwoing link to change user language at runtime:
Changing the language at runtime in X++

Easy way to get SID

Most of the time when we switch back and forth from staging to production environment, we want to get the SID for the current user setting, here are the steps you  can perform to scussfully logon to Dynamics AX:
1. Open the command prompt and type "wmic path win32_useraccount where name="{Domain user name}" get sid"
2. Copy the SID.
3. Open the SQL server and write following command to update current admin user:

             use {AX DB}
             update USERINFO
             set SID = '{paste the SID here from step#2}', NETWORKDOMAIN='{Network domain}',         NETWORKALIAS='{User Id}' where ID='Admin'