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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 14.10.2011, 23:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
dynamicsaxtraining: Module logo
Источник: http://www.dynamicsaxtraining.com/kn...nt/module-logo
==============

Hi! I have received the following task: Create new module in Dynamics AX and assign image or logo to this module.

Let’s develop this task.

Module is created very easy:
  1. Go to the AOT > Menus and create new menu.  For example TestMenu.
  2. Add menu item. For example CustTable menu item.
  3. Then create new menu reference in the MainMenu menu:
    • On the MainMenu menu clicks the right mouse button and select New > Menu reference. The Select: Menus windows opens.
    • Drag and drop the TestMenu menu from Select:Menus window to the MainMenu.
New menu


This is all. The new module have been added. Reopen Dynamics AX application.

The new modules appears without image (to move module on the top position clicks the Microsoft Dynamics AX >View > Navigate Pane Options…):

New module without logo


Adding module logo is not so easy. Select the TestMenu menu in the AOT, click right mouse button and select Properties. There are two properties NoramlImage and NormalResource.

Menu properties


In the NormalImage property the file path to the logo could be specified. But if we create product for sell then we can not specify the exact file path because each Customer will have own path.

In the NormalResource property the image id could be specified. It is suitable for our requirements. Let’s add image in Dynamics AX:
  1. Go to the AOT > Resources. Click right mouse button and select Create form file.
  2. Specify the file path and click Open.
The new image resource will be created:

Image resource


But this resource doesn’t have the resource id or image id property. Even more in the NormalResource property only the resource id of standard image can be specified. Standard image could be review here AOT > Forms > SysImageResources.

Trick: we will use the NormalImage property and Logo_image_png resource.

Create the following static method:
static client void addImageToModule()
{
TreeNode treeNodeMenu;
;

treeNodeMenu = SysDictMenu::newMenuName(menustr(TestMenu)).parmTreeNode();
if (treeNodeMenu)
{
treeNodeMenu.AOTsetProperty(identifierstr(NormalImage), SysResource::getImagePath(resourcestr(Logo_image_png)));
treeNodeMenu.AOTsave();
}
}

Call this method in the \Classes\Application\startupPost method:

// No SYS code must exist in this method
// If you need the startup command, look in the class SysStartupCmd
void startupPost()
{
;
Class1::addImageToModule();
}

Reopen application.

Module with logo


All the best



Technorati Tags: image id, menu logo, module image, resource id



Источник: http://www.dynamicsaxtraining.com/kn...nt/module-logo
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: Kabardian (0).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxtraining: Production life cycle Blog bot DAX Blogs 0 16.07.2011 01:23
dynamicsaxtraining: Transfer orders Blog bot DAX Blogs 0 03.03.2011 15:11
dynamicsaxtraining: Quality management Blog bot DAX Blogs 0 12.02.2011 00:11
dynamicsaxtraining: Quarantine management Blog bot DAX Blogs 0 11.01.2011 21:11
dynamicsaxtraining: Setup initial data (Vendor, Warehouse, Equipment) Blog bot DAX Blogs 0 07.12.2009 19:05

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

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

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