Notifications
Announcements
No record found.
Hi Everyone
I would like to run a checking when the sales order quantity are change, can anyone please advice how and where can i do this event handler?
Thank You
Best Regards
Kuan Yi
*This post is locked for comments
You can use the standard functionality for alerts. Or you can write a piece of code executed by update() that will compare the current quantity with the previous quantity - see how SalesLine_Orig is used in SalesLineType.update().
When any value in the SalesLine is changed, it will go through the method "modifiedField" in SalesLine (Table). There you will find cases for fields that are monitored.
There you can put your event handler.
modifiedField() is usually not a good choice. It's triggered when a value changes, but there is no guarantee that the record will be ever saved, therefore the event would report a change that - from database perspective - never happened. That's why it's a good idea to trigger such things on saving.
Also, modifiedField() is automatically triggered only by user changes in forms, which may be wrong if we want to catch all situations when quantity changes.
I agree with you Martin. Its more sophisticated to make events on update() with comparison to _Orig.
I just came from my similar case and we did it on modifiedField(), because that was our client's intention.
Here we don't know what is the specific requirement.
Can you give me an example if i want to trigger at ExpectedRetQty in salesline Table?
Regards
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 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2