Reset program cache file for all clients

I had a problem with some clients running on old code (e.g. experiencing bugs that have already been fixed).

The following job resets the GUID which in turn forces all clients to create a new program cache file (AX_*.auc). A restart of the AOS is required.

static void forceNewAUC(Args _args)
{
    #AiF
    SysSQMSettings sysSQMSettings;
    ;
    ttsbegin;
    update_recordset sysSQMSettings setting GlobalGUID = str2Guid(#EmptyGuidString);
    ttscommit;
    info("Restart the AOS Service to generate a new GlobalGUID.");
}

(Source: http://blogs.msdn.com/emeadaxsupport/archive/2010/01/25/identical-ax-2009-auc-file-created-for-multiple-ax-installations.aspx)

Another option would be adding the following to the Info.startupPost() method, however I’m not sure if this is a cleaver thing to do routinely, but if you cannot restart the AOS it is you only option.

xSession::removeAOC();
SysTreeNode::refreshAll();
SysFlushDictionary::doFlush();
SysFlushAOD::doFlush();
xSession::updateAOC();

(Source: http://dynamics-ax.blogspot.com/2006/04/flush-aos-cache-from-code.html)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s