web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Event Handler on Edit Field Change

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Martin Dráb Profile Picture
    237,892 Most Valuable Professional on at

    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().

  • Erol Celebic Profile Picture
    420 on at

    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.

  • Martin Dráb Profile Picture
    237,892 Most Valuable Professional on at

    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.

  • Erol Celebic Profile Picture
    420 on at

    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.

  • Community Member Profile Picture
    on at

    Hi Everyone

    Can you give me an example if i want to trigger at ExpectedRetQty in salesline Table?

    Thank You

    Regards

    Kuan Yi

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans