X++ Code to Export AOT Object / automatic backup of XPO's.
Today am here to convey the most vital subject for MS dynamics AX.
Development or customization's are the most important topic which should be saved or backup need to be taken on daily or weekly basis.
We need to take daily backup of our development (in terms of XPO), but we all always forget because of our hectic work schedules.
So use the following job and build batch application to take backup of development in terms of XPO.
We can take AOD file also but the size will be more and needs to stop AOS every time.
Same as creating
Create a New Table by using X++ code
Following job illustrates how to export/backup all AOT Classes object.
void ExportTreeNodeExample()
{
TreeNode treeNode;
FileIoPermission perm;
#define.ExportFile(@"D:\AOTclasses.xpo")
#define.ExportMode("w")
;
perm = new FileIoPermission(#ExportFile, #ExportMode);
if (perm == null)
{
return;
}
perm.assert();
treeNode = TreeNode::findNode(@"\Classes");
if (treeNode != null)
{
// BP deviation documented.
treeNode.treeNodeExport(#ExportFile);
}
CodeAccessPermission::revertAssert();
}
No comments:
Post a Comment