Sunday 8 July 2012

AX Job to export Security Key to CSV file.

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:

Update NuGet package to new MS D365FO version

1. Import the NuGet package files from LCS for that particular version please take the PU version files only. a. Goto LCS-->Asset Libra...