Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Suggested answer

How to trigger OnChange event when the field is updated through Plugin

Posted on by 35

Hi all

I have registered on change event on a field and I am updating that field using the plugin, but the onchange event is not triggering even when the field is updated.

Can anyone help me with this?

  • Ria roy Profile Picture
    Ria roy 35 on at
    RE: How to trigger OnChange event when the field is updated through Plugin

    I am refreshing the form using onchange event because the update in the plugin doesn't call refresh event.

  • Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: How to trigger OnChange event when the field is updated through Plugin

    when you save the form, your plugin is triggered and after save the form reloads. Are you updating this field from another form.

    In order for the OnChange event to trigger, the field should know something changed else it will not trigger.

    You can shift the onChange logic to the plugin code.

    Best Regards

    PG

  • Ria roy Profile Picture
    Ria roy 35 on at
    RE: How to trigger OnChange event when the field is updated through Plugin

    Hi Pankaj,

    Thanks for your response.

    I need to call the onchange event without refreshing the form when the field is updated through the plugin.

  • Suggested answer
    Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: How to trigger OnChange event when the field is updated through Plugin

    Hi,

    The onChange event usually occurs when the data in a form field has changed and focus is lost. This event also occurs when data changes on the server are retrieved to update a field when the form is refreshed, such as after a record is saved.

    When the plugin is triggered? Once the form is saved and refreshes, the field value will be changed which should trigger the onChange. You can try using the fireOnchange,

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/attributes/fireonchange

    Best Regards,

    PG

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans