Notifications
Announcements
No record found.
Hello every one ,
i need to insert a data in customized table after the record created in sales table
Hi Ahmed,
are you working with AX (2012 or older) or D365 Finance & Supply Chain Management?
i'm working with D365 F&O
Moved to D365 Finance forum.
You can use Chain of Command to run your logic after insert() method of SalesTable has been called.
docs.microsoft.com/.../method-wrapping-coc
Hi Nikolaos,
i'm trying to do it in COC but if the record not created it also will do the action
I don't understand your description. May I suggest that you share as much information as possible, so that we have better chance of helping you? For example, if you have some problems with your code, you have to remember that people who can see the code have much better chance of spotting possible issues in it.
In addition to this, I would like to ask you to debug your code to understand what it does.
Thanks!
Thanks for your replay the below is a sample from my code , i just need to take an action after the record inserted
[ExtensionOf(tablestr(WMSPickingRoute))]
final class WMSPickingRoute_Extension
{
void insert()
next insert();
Info("Inserted");
}
Hi,
thanks for sharing your code.
It looks like you have implemented it in wrong table (WMSPickingRoute) - your requirement was to hook in insert of SalesTable. Additionally, please remember to use your prefix in the class name to avoid naming conflicts.
But in general it looks good - it will run your code whenever a record is inserted in the related table (WMSPickingRoute).
Just add a condition
if(this.recID) info(inserted);
yes it's a different table i need to add action it also , but when use the above code it also execute the info code even if the record didn't created
When does it happen that insert() completes successfully (without throwing an exception) but it doesn't create a record? It sounds like a violation of contract to me.
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 584 Most Valuable Professional
André Arnaud de Cal... 499 Super User 2025 Season 2
Sohaib Cheema 254 User Group Leader