Exporting the AOT Objects through X++

Hi,
X++ Code to Export AOT Object / automatic backup of xpo’s.
we need to take daily backup of our development (interms of xpo) , but we all always forget becuase of our hectic work schedules.
So use the following job and build batch application to take backup of developement in terms of xpo .
We can take aod also but the size will be more and needs to stop AOS everytime .

Following job illustrates how to export/backup all AOT Classes object.

static void exportAOT(Args _args)
{
TreeNode treeNode;
FileIoPermission perm;
#define.ExportFile(@”D:\CHAIT.xpo”)
#define.ExportMode(“w”)
;

perm = new FileIoPermission(#ExportFile, #ExportMode);
if (perm == null)
{
return;
}
perm.assert();
treeNode = TreeNode::findNode(@”\data dictionary\tables\ExcelFileImport”);
if (treeNode != null)
{
// BP deviation documented.
treeNode.treeNodeExport(#ExportFile);
}
CodeAccessPermission::revertAssert();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s