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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 22.12.2016, 21:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Event Handler Methods in Dynamics 365 for Operations (AX7)
Источник: https://stoneridgesoftware.com/event...ethods-in-ax7/
==============

*Please note: New Dynamics AX (AX7) has been renamed Dynamics 365 for Operations.

In Dynamics 365 for Operations (AX7) the preferred mechanism for customizations to existing objects is to use event handlers to react to various events rather than overriding methods on tables, forms, and classes. For example, to change what happens when a button is clicked in AX 2012 you override the clicked method and put code either before or after the super() call. In Dynamics 365 for Operations (AX7) you can react to the OnClicked event by copying the event handler method for the event and pasting the method into a class. Below is an example of an event handler method that reacts to the OnClicked event of a button on a form.

[FormControlEventHandler(formControlStr(HcmWorker, ArgsExampleButton), FormControlEventType::Clicked)] public static void ArgsExampleButton_OnClicked(FormControl sender, FormControlEventArgs e) { Args args = new Args(); Form formToCall = new Form('ArgsDemo_Callee'); FormButtonControl callerButton = sender as FormButtonControl; //Retrieves the button that we're reacting to FormRun form = callerButton.formRun(); //Gets the running HcmWorker form //Get the HcmWorker that was selected in the HcmWorker form FormDataSource hcmWorker_ds = form.dataSource(formDataSourceStr(HcmWorker, HcmWorker)) as FormDataSource; HcmWorker hcmWorker = hcmWorker_ds.cursor(); //Set up args with all of the information you've retrieved args.caller(form); args.object(formToCall ); args.record(hcmWorker); form = ClassFactory.formRunClass(args); form.init(); form.run(); form.wait(); }



Источник: https://stoneridgesoftware.com/event...ethods-in-ax7/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
jaestevan: Microsoft Dynamics 365 for Operations Blog bot DAX Blogs 0 02.11.2016 01:11
Серия видеоуроков по ax7 (Dynamics 365 for Operations), на которых виден интерфейс mazzy Полезное по Microsoft Dynamics 0 28.10.2016 08:13
stoneridgesoftware: Dynamics NAV Automatic Data Entry Tools That Save You Time Blog bot NAV: Blogs 0 15.06.2016 03:27
NAV Team: Upgrading from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 to Microsoft Dynamics NAV 2015 Blog bot Dynamics CRM: Blogs 0 23.02.2015 13:00
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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