Notifications
Announcements
No record found.
I added one field "myinventlocationId" in InventTable. I need write logic for filling this filed by inventlocationid in Inventlocation using event handler.
I think there is a relations between Inventtable - "ItemId" -inventtrans - "inventDimId" -inventDim - "InventlocationId" -Inventlocation
Can you please help me to fill this new myinventLocationid field in InventTable.
Hi, Please provide more information on your requirement.
You can extend InventTable to add a new field. For mapping field, it can be done via event handlers or Chain of command.
Actually question is the requirement I extended invent table field added.
Through Event handlers implement the logic of filling the new field. Which event handler and what logic we need to write in event handler is my question sir
You can use oninserted or oninserting event handler to write the logic. Once you copy paste that in new class just do a find reference and check how it is implemented in standard and use the same way to write the logic.
You can use onInserting event handler but I prefer to create a extension class for table and use CoC (Chain of command) on insert method
Event Handler: rajusdynamics365ax.home.blog/.../
CoC: dynamics365musings.com/.../
For CoC, before next insert() statement, map your new field.
If your requirement is to map field based on some conditions after inserting a record then onInserted event handler or after next insert() can be used.
Can you please reread the requirement and help me to solve this question
Your new requirement is not very clear, however to create InventLocationId in InventTable, you can leverage the code mentioned in this thread in pre-insert event handler and map value to myLocationId field.
community.dynamics.com/.../how-to-find-inventlocationid-from-itemid-inventtable
Can you please provide more details? So that we can understand if it is through batch or realtime or just for that record or how is that?
I added one field "myinventlocationId" in InventTable through extension. I need write logic for filling this filed by inventlocationid using event handler.
InventDim table having Inventlocationid.
I need to get that field values into myinventlocationId through event handler.
I facing issue to find which event handler I need to take and logic to fill field with inventlocationid.
InventDim can have multiple records with ItemId from InventTable. There is no direct relationship with InventDim and InventTable. If you can tell us about your business requirement then we might help you.
I understood that you need to add value in your custom field 'myinventlocationId; in InventTable. However, what should be the value is still not clear and is it during creation of record in InventTable.
If you need to insert Default location in InventTable, please check this article (Same code I shared before) and add in post event handler for insert method of InventTable.
microsoft-dynamics-ax-erp.blogspot.com/.../how-to-get-item-default-inventory.html
We understood your requirement that you need to add or populate the data to that new field. But my question is if you use event handler, only when inserting new record or updating a record only that change comes but not for records already in the db. So I am asking what is the exact requirement is it simply for one line or real time or how? Please let us know requirement than you can ask your issue.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 663 Most Valuable Professional
André Arnaud de Cal... 540 Super User 2025 Season 2
Sohaib Cheema 348 User Group Leader