xSession::getSysTraceActive Method [AX 2012]
Enables you to determine whether system tracing is turned on for the session.
The following example uses the getSysTraceActive method to determine the original setting for system tracing and to reset the setting after tracing is temporarily set to false.
server static void main(Args a)
{
SysDataImport sysDataImport;
boolean sysTraceActive = xSession::getSysTraceActive();
sysDataImport = SysDataImport::newTmpFilename('');
sysDataImport.addTmpExpImpTable(
tablenum(SysTraceTableSQL),
false);
sysDataImport.addTmpExpImpTable(
tablenum(SysTraceTableSQLExecPlan),
false);
sysDataImport.addTmpExpImpTable(
tablenum(SysTraceTableSQLTabRef),
false);
xSession::setSysTraceActive(FALSE);
if (sysDataImport.prompt())
sysDataImport.run();
xSession::setSysTraceActive(sysTraceActive);
}
Show: