Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2016 Online OnChange Event Not triggering the Javascript function when changing the field value from Custom Ribbon.

(0) ShareShare
ReportReport
Posted on by

Hi Team,

I have added a Custom Ribbon Button on the CRM form which updates the OptionSet Value of a field on the form.

The field is getting updated but the OnChange Event Registered on the the field is not getting triggered.  And also if i click the Ribbon Button next time, its  getting corrupted in the second time.  I guess these is some problem with the OnChange Event in CRM 2016 Online. 

Are you guess having the same issue ?

*This post is locked for comments

  • awad Profile Picture
    on at
    RE: CRM 2016 Online OnChange Event Not triggering the Javascript function when changing the field value from Custom Ribbon.

    Hi Team,

    Please ignore my last comment. your responses resolved my issue.

  • awad Profile Picture
    on at
    RE: CRM 2016 Online OnChange Event Not triggering the Javascript function when changing the field value from Custom Ribbon.

    Hi Tim and All,

    Thanks for your response.  I added the fireOnChange function as suggested but. I have one more issue that i mentioned that the Ribbon Javascript function is getting corrupted when i set the option set value using  Xrm.Page.getAttribute("fieldname").setValue(2);  from the Ribbon Javascript function. 

    when i comment the above statement the ribbon button starts working again.  I don't understand what's the issue here. i done see any javascript error either. 

    Appreciate your inputs & suggestion.

    Thanks & Regards,

    Awad.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: CRM 2016 Online OnChange Event Not triggering the Javascript function when changing the field value from Custom Ribbon.

    use this in your script Xrm.Page.ui.refreshRibbon();.

    as per onchange event use fireonchange as suggested by Tim Dutcher

  • Verified answer
    Inogic Profile Picture
    454 on at
    RE: CRM 2016 Online OnChange Event Not triggering the Javascript function when changing the field value from Custom Ribbon.

    Hi Awad,

    Yes, as per the Time Dutcher reply, try with fireOnChange() function.
    You can use this function after updating the OptionSet field, as like below:
    Xrm.Page.getAttribute(nameOfAttribute).fireOnChange()

    Thanks,
    Sam

  • Verified answer
    Tim Dutcher Profile Picture
    2,100 on at
    RE: CRM 2016 Online OnChange Event Not triggering the Javascript function when changing the field value from Custom Ribbon.

    Calling the fireOnChange function for the field might resolve the issue. msdn.microsoft.com/.../gg334409.aspx

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,998 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,850 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans