AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 22.12.2016, 21:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Join Date: 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, напишите личное сообщение администратору.
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 17:48.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.