static void WIK_SilentDBSynch(Args _args)
{
#define.showSysSqlSync('showSysSqlSync')
SysGlobalCache gc = appl.globalCache();
FormName owner = formStr(SysSqlSync);
// Store the pre-existing Global Cache state
boolean gcEntryExists = gc.isSet(owner, #showSysSqlSync);
anytype gcValue = gc.get(owner, #showSysSqlSync);
// Suppress user interaction
gc.set(owner, #showSysSqlSync, NoYes::No);
// Synchronize the Data Dictionary
appl.dbSynchronize(0, false);
// Restore the previous Global Cache state
if (gcEntryExists)
{
gc.set(owner, #showSysSqlSync, gcValue);
}
else
{
gc.remove(owner, #showSysSqlSync);
}
}
Labels: DB Synch, Dynamics AX, Dynamics AX 2012, Global Cache, TFS, VCS, X++