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:

How to Disable “Advanced Filter or Sort” and Enforce Custom Filters on Any D365FO Form

 In Dynamics 365 Finance and Operations, users can apply filters through the “Advanced filter or sort” feature found under the Options tab...