Источник:
http://workflowax.wordpress.com/2012...del-importing/
==============

For those of you who have been working on AX 2012 and have been using the AXUtil tool for importing, exporting and deleting models, you’ve probably run into a significant amount of frustration. Leading to the inevitable question: Why didn’t AX2012 ship with some sort of visual interface to accomplish Model management?
Although I cannot answer this, I can, for those of you who are interested in getting your hands dirty with a bit of C# code, point you in the right direction of how to build your own interface with relative ease.
Recently i discovered a handy little dll that really makes writing a model management program a breeze. Its located at: C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities\AXUtilLib.dll. This inconspicuous dll exposes all the functionality of the AXUtil.exe program directly to the developer. For example to delete a model (in a C# application):
AxUtilContext context = new AxUtilContext(); AxUtilConfiguration config = new AxUtilConfiguration(); config.Server = 'SQLSERVERNAME'; config.Database = 'DATABASENAME'; string modelName = 'TestModel'; if (modelName != "") { if (MessageBox.Show( "Are you sure you wish to delete model " + modelName + "?","Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes) { config.ModelArgument = new ModelArgument(modelName); AxUtil util = new AxUtil(context, config); util.Delete(context, config); if (context.HasError) { MessageBox.Show("Failed to delete model " + modelName, "Error", MessageBoxButtons.OK); ICollection errors = context.Errors; IEnumerator enums = errors.GetEnumerator(); while (enums.MoveNext()) { console.write(enums.Current); } } else { MessageBox.Show("Model Deleted", "Model Deleted", MessageBoxButtons.OK); } this.reloadModels(); }}You can use the AXUtil class to do your import, export, get a list of all installed models etc…
Below is a quick demo of an application I wrote to do basic importing, listing and deleting models.
Please leave some comments if you have had the chance to explore this
Источник:
http://workflowax.wordpress.com/2012...del-importing/