Wednesday, May 21, 2014

AX Job to export Security Key to CSV file.

//AX Job to export Security Key to CSV file.
Error ...

static void AOTGetProperty(Args _args)
{
 #aot #properties Boolean writeFile;
Boolean infoDebug;
CommaIo outFile;
TreeNode tn = TreeNode::findNode(#SecurityKeysPath);
str securityKeysName;
str securityKeyID, Property;
int sID; str errMsg; ;
infoDebug = false;
// ***OPTION*** View InfoLog Output (true / false) writeFile = true;
// ***OPTION*** Export results to CSV file (true / false) errMsg = "";
 //"--- NOT DEFINED ---";
//C:\Users\m.a.gudidevuni\Documents outFile = new AsciiIo("C:\\GTA\\SecurityKey.CSV","W");
outFile.outFieldDelimiter("\r\n");
outFile.outRecordDelimiter("\r");
tn = tn.AOTfirstChild();
while (tn)
{
securityKeysName = findProperty(tn.AOTgetProperties(), #PropertyName);
securityKeyID = findProperty(tn.AOTgetProperties(),#PropertyId);
sID = tn.applObjectId();
if(infoDebug)
{
info(strfmt('SecurityKeysName %1 with ID : %2',securityKeysName,sID));
}
if(writeFile)
{
 outFile.write(securityKeysName + " , " + strReplace(int2str(sID),",",""));
}
// info(strfmt('SecurityKeysName %1 with ID : %2',securityKeysName,sID));
// Property = tn.AOTgetProperties();
// info(strfmt('%1', findProperty(Property, 'ID')));
// info (strfmt( // 'SecurityKeysName %1 has the ID property specified as %2', // securityKeysName, securityKeyID));
tn = tn.AOTnextSibling();
}
}

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...