AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.03.2012, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
workflowax: Creating a Visual Interface for AX2012 Model Importing
Источник: 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/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Creating and Deploying XAML Workflows using the CRM Developer Toolkit Blog bot Dynamics CRM: Blogs 0 05.11.2011 05:59
Channel9: AX2012 - Creating an ISV Model Blog bot DAX Blogs 6 06.02.2011 12:37
mfp: Seeing is believing - AX2012 Creating an ISV Model Blog bot DAX Blogs 0 04.02.2011 19:11
workflowax: Importing workflows – Configuration IDs Blog bot DAX Blogs 0 07.09.2010 13:05
workflowax: What is a workflow owner used for? Blog bot DAX Blogs 0 01.06.2010 15:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:46.