Announcements
When a record is created from the form level and the item id is given then I want the vendor details to be filled automatically based om the item id.
So do i use onintialized eventhandler or initvalue ?
What is the difference?
Should is use oncreated or oncreating?
What is onactivated used for?
use modifiedfeild method on the itemId filed, so if any change happens you can recall the data you want in another fields
Yes you can. By the way, the quickest way to answer "can I?" questions is usually to try it!
Sir can I use the onmodified eventhandler?
For your requirement, you should hook in the modification of itemId field, as Martin wrote.
About your many questions about differences:
- onInitialized event is fired after super() call of initValue method
- onCreated is fired after super() call of create method, onCreating is fired before it
- onActivated is fired after super() call in active method. If you want to run some logic when active (selected) record changes, this is the place
Functionally there's no difference whether you write your code in active method or use onActivated event handler. Technically the difference is that you either write on top of the standard code (overlayering) or you hook into events that the standard code provides, and place your code in your own classes.
In D365FO you can't overlayer so you can only use event handlers or Chain of Command (which doesn't exist in AX2012) when you want to enhance the functionality of the standard objects.
Initialization happens before users can set the item ID, therefore neither initValue nor onIntialized will help. Most likely you want to run the logic when item ID changes, e.g. in modifiedField() method on the table.
André Arnaud de Cal...
293,998
Super User 2025 Season 1
Martin Dráb
232,850
Most Valuable Professional
nmaenpaa
101,158
Moderator