Posts

Showing posts from January, 2016

Business Connector Cache/Store Data In Memory

Image
During development in Dynamics AX 2009 and using business connector to get data from Dynamics AX i faced a problem that result were stored in cache and not reflecting the changes, to resolve this issue when i made changes on Dynamics AX i restart the AX service but after some time it stops working and it again not reflecting the changes, so i add following line of code in business connector code after logging in and it start working. Axapta ax = new Axapta(); ax.LogonAs(credentials.UserName, credentials.Domain, new System.Net.NetworkCredential(credentials.UserName, credentials.Password), null, null, null, null); ax.CallStaticClassMethod("SysFlushAOD","doFlush"); ax.CallStaticClassMethod(“SysFlushAOD”, “doFlush”);

Get Current User and Employe Infomation

Image
Retrieves the nonnumeric ID that represents the current user. curUserId(); Following function will return the name associated with the current user. XUserInfo::find(false, curUserId()).name; In order find out the employee linked to the current user. AX 2009: EmplTable::find(SysCompanyUserInfo::find(curUserId()).EmplId); AX 2012: HcmWorker::find(DirPersonuser::findUserWorkerReference(curUserId())).name();