static void AKExportProjects(Args _args) { #AotExport TreeNodeIterator tni; ProjectNode projectNode; int exportFlag; Dialog dialog = new Dialog(); DialogField folderName; DialogField projectDefinitionOnly; DialogField exportFromLayer; DialogField projectType; UtilEntryLevel layer; dialog.addText("This will export all projects (shared or private) that exist in a selected model."); projectType = dialog.addFieldValue(enumStr(ProjectSharedPrivate), ProjectSharedPrivate::ProjPrivate); projectDefinitionOnly = dialog.addField(extendedTypeStr(NoYesId), 'Project Definition Only'); folderName = dialog.addField(extendedTypeStr(FilePath)); exportFromLayer = dialog.addField(enumStr(UtilEntryLevel), 'Projects from layer'); dialog.run(); if (dialog.closedOk()) { if (!folderName.value()) throw error("Missing folder"); exportFlag = #export; if (projectDefinitionOnly.value()) exportFlag += #expProjectOnly; layer = exportFromLayer.value(); switch (projectType.value()) { case ProjectSharedPrivate::ProjPrivate: tni = SysTreeNode::getPrivateProject().AOTiterator(); break; case ProjectSharedPrivate::ProjShared: tni = SysTreeNode::getSharedProject().AOTiterator(); break; } projectNode = tni.next() as ProjectNode; while (projectNode) { if (projectNode.AOTLayer() == layer) projectNode.treeNodeExport(folderName.value() + '\\' + projectNode.name() + '.xpo', exportFlag); projectNode = tni.next() as ProjectNode; } } else warning("No action taken..."); }
This technical blog will be about my adventures with Microsoft Dynamics 365 for Operations (AX7/D3fo), AX 2012, and AX 2009.
Thursday, September 10, 2015
How to export all private or shared projects with or without project definitions from a specified layer
I often have to switch development machines, and when I do, I lose all of my private or shared projects. This is a good way to backup your projects and/or their definitions.
Subscribe to:
Post Comments (Atom)
Wow, what a great post for all the engineers out there especially the software and computer. I must say great skill of coding and arranging such data in a great format. Wonderful!
ReplyDelete