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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Which event handler will I choose for update all the existing records of field values assign through event handler

(0) ShareShare
ReportReport
Posted on by 35

I tried onupdating but it is selecting only one record at a time I need to update all the records of myinventlocationId field values in the InventTable.

Can you suggest me which event handler use useful for update all records through event handler class.

I have the same question (0)
  • Suggested answer
    Komi Siabi Profile Picture
    13,109 Most Valuable Professional on at

    For existing records, you can create a Runnable class and use a while select to update the records.

  • learner.d365 Profile Picture
    35 on at

    That runnable class I tried and it is working but in My task I need to this through event handler only. Is there any event handler available for this requirement.

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Event handler will be called whenever an event happens in the form like editing a record, updating a record, inserting record etc.

    If you want to update all records, you need to go for the runnable class which is formerly known as "Script".

    So, there is no event handler concept for your scenario.

    Thanks,

    Girish S.

  • learner.d365 Profile Picture
    35 on at

    Actually this this is the full requirement

    Add a new field that is named MyInventLocationId to the InventTable table through extension. implement the logic of filling the new field through event handler.

    InventTable having Inventlocationid () method I need to call this method like as "InventTable.MyInventLocationId = InventTable.InventLocationId();

    I need to fill this myinventlocationId field by calling this method through event handler.

    If this possible please suggest me which event handler will I take

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

    You should have rejected such a requirement, because - as you see - it doesn't allow you to design a solution. It's a bunch of implementation details without describing the goal.

    Which event handler you should use (if any) depends on what event you want to react to, not what code you want to execute.

    Also, "to use an event handler" isn't a business requirement. You're the developer; it's your responsibility to choose the appropriate technical solution for the given business requirement. But you can't design a solution without knowing what it should do, therefore ask your key user or a functional consultant to explain the business goal to you, instead of trying to design code on your behalf.

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    We have discussed it in another thread, this is a development practice requirement. As discussed, issue is that it's not a business requirement and it doesn't tell from where you should get myLocationId field and why to use event handler only.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans