Monday, 9 July 2012

Tree Node for Security Key and write to text file.

static void TextFile_TreeNood_Demo(Args _args)


{

AsciiIO tmpfile;

Filename tmpfilename;

FileIOPermission permission;

#File

#AOT

TreeNode treeNode;

TreeNode treeNodeTables = TreeNode::findNode(#SecurityKeysPath);

tmpfilename = WinApi::getTempFilename(WinAPI::getTempPath(),'SecurityKey');

permission = new FileIOPermission(tmpfilename,#IO_write);

permission.assert();

tmpfile = new AsciiIO(tmpfilename, #IO_write);

if(tmpfile.status()==IO_Status::Ok)

{

tmpfile.outRecordDelimiter('\n');

tmpfile.outFieldDelimiter(';');

}

else

{

return;

}



while (treeNode != null)

{

tmpfile.write(strfmt('Name: %1, ID: %2',treeNode.AOTname(), treeNode.applObjectId())); /

}

tmpfile = null;

CodeAccessPermission::revertAssert();

}

No comments:

Import and Export file from BLOB storage Account(Azure) in D365 F&O using X++

  Import and Export file from BLOB storage Account in D365 F&O using X++ Import: /// <summary> /// MKInventQualityOrderLineService...