X++ Code to Export AOT Object / automatic backup of XPO's.
Hi friends, hope all is well!! J
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.
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();
}
Keep reading!!
J
Check this file
ReplyDeletehttps://www.box.com/s/khmpb1u4x8ydt9sj7iie
It's made for Dax 2012 . I export all xpos into a folder and search there after this
hi adiso,
DeleteThanks for sharing the XPO related to DAX2012.
thanks, but how can I import object to AOT by code, please?
ReplyDeleteUse standard class SysImportElements to get this. Just a simple example:
DeleteSysImportElements sysImportElements = new SysImportElements();
sysImportElements.newFile("D:\\testing.xpo");
sysImportElements.parmImportAot(true);
sysImportElements.parmImportWithIds(false);
sysImportElements.import();
Hello Vishal thanks for that codes, but if i want to backup specified name only how is it gonna be?
ReplyDelete*example i want to backup jobs started with name like EU_JBS* ....
This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. Microsoft Dynamics 365 Business Central Credit Card Processing
ReplyDeleteI was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more. Windows
ReplyDeleteReally appreciate this wonderful post that you have provided for us.Great site and a great topic as well i really get amazed to read this. Its really good. wazirx referral code
ReplyDeleteAfter i truly motivate you to definitely realize that term it happens to be pleasure recognized... puzdro samsung
ReplyDelete