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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 22.12.2017, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
24,022 / 809 (75) +++++++
Регистрация: 28.10.2006
ievgensaxblog: D365FOE. Form personalization for developers.
Источник: https://ievgensaxblog.wordpress.com/...or-developers/
==============



Often in AX one form could be used for different business entities, like customer and vendor external items. And because they use same CustVendExternalItem form under the hood personalization of it affects all entities in the same time. But what if user wants to add new control via personalization only for customer’s and does not want to see it for vendor’s external items?  Now it is possible with a small customization.

In D365 new FormRunConfigurationClass class has been introduced to control form personalization. It saves and restores all changes done by user: new controls added via personalization, columns resize, columns hide, etc. Each form has new property – configurationOwner() that is used by FormRunConfigurationClass to resolve configuration. By default, it is equal to a form name.

To split customer external items and vendor external items form personalization all we need to do is to set configurationOwner()  to overAllModule in the init() method of CustVendExternalItem  form, that is equal to ModuleInventCustVend::Cust for customer and to ModuleInventCustVend::Vend for vendor:

[ExtensionOf(formStr(CustVendExternalItem))]public final class CustVendExternalItemForm_Extension{ public void init() { //copy-pasted this code from init method because it resolves module after super() and we need it before switch (this.args().parmEnum()) { case ModuleInventPurchSalesVendCustGroup::Purch, ModuleInventPurchSalesVendCustGroup::Vend, ModuleInventPurchSalesVendCustGroup::VendGroup: // set personalization owner this.setConfigurationOwner(enum2str(ModuleInventCustVend::Vend)); break; case ModuleInventPurchSalesVendCustGroup::Sales, ModuleInventPurchSalesVendCustGroup::Cust, ModuleInventPurchSalesVendCustGroup::CustGroup : // set personalization owner this.setConfigurationOwner(enum2str(ModuleInventCustVend::Cust)); break; } next init(); }}This property should be set before super() of init() method of the form, so if you have controls added in the run-time it won’t affect them. However, FormRunConfigurationClass can load saved personalization for this control as well. Let’s expand our example with new run-time control and load personalization for it:

[ExtensionOf(formStr(CustVendExternalItem))]public final class CustVendExternalItemForm_Extension{ public void init() { //copy-pasted this code from init method because it resolves module after super() and we need it before switch (this.args().parmEnum()) { case ModuleInventPurchSalesVendCustGroup::Purch, ModuleInventPurchSalesVendCustGroup::Vend, ModuleInventPurchSalesVendCustGroup::VendGroup: this.setConfigurationOwner(enum2str(ModuleInventCustVend::Vend)); break; case ModuleInventPurchSalesVendCustGroup::Sales, ModuleInventPurchSalesVendCustGroup::Cust, ModuleInventPurchSalesVendCustGroup::CustGroup : this.setConfigurationOwner(enum2str(ModuleInventCustVend::Cust)); break; } next init(); //add runtime control FormGridControl gridControl = this.design().controlName(formControlStr(CustVendExternalItem, Grid)); FormStringControl newControl = gridControl.addControl(FormControlType::String, 'NewControl'); newControl.label('New control'); //load personalization for runtime control this.configurationHelper().getLoadedConfigurationProfile().applyRuntimePropertiesForControl(this, gridControl, newControl); }}That’s only two examples of FormRunConfigurationClass usage, but I’m sure that my curious reader will find more.




Источник: https://ievgensaxblog.wordpress.com/...or-developers/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Теги
персонализация форм

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ievgensaxblog: D365FOE. FormHasMethod extension for form extension methods. Blog bot DAX Blogs 0 16.11.2017 10:11
dynamicsaxtraining: Vendor returns Blog bot DAX Blogs 0 11.10.2012 00:11
dynamicsaxtraining: Purchase Blog bot DAX Blogs 0 11.03.2012 05:25
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:01.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.