Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Javascript OnChange Event After Synchronous Plugin Update

Posted on by 240

Hello,

I have an question regarding the Javascript onChange Event in Forms for CRM Online.

In a particular scenario, I update a single value in FieldA.

This triggers a Synchronous Plugin, which in turn updates the value of Field B and Field C on the entity.

Fields B and C have OnChange Event handlers defined against them.

These updates leave the record in the correct state.

I believe this code may have initially come from CRM 2013, when the entire form would reloaded post save.

In CRM Online, when the form refreshes. The OnChange() event is now being triggered against Field B and Field C as the data has changed on the server.

This is causing issues as the plugin has perfomed the correct updates. I do not want the OnChange event to fire in this scenario.

So, the more general question is this:

Is there anyway to determine if an onChange event has been triggered due to an actual user interaction with the User Interface, rather than by a field refresh post save?

  • Marco.P Profile Picture
    Marco.P 2,405 on at
    RE: Javascript OnChange Event After Synchronous Plugin Update

    Hi @Shaun Harvey,

    Any news? How'd you decide to proceed?

  • Suggested answer
    Marco.P Profile Picture
    Marco.P 2,405 on at
    RE: Javascript OnChange Event After Synchronous Plugin Update

    Hi,

    I don't think you can get such informations (but hey other memebers, please prove me wrong!). If i were you, i would make my plugin running on behalf of a particular user (example: It_Adm_user) and then on js function check the modified by field to prevent the body function to execute.

    Hope it helps!


    If you found the answer helpful for you or other readers, please mark as Verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans