Skip to main content
Microsoft Dynamics CRM forum
Answered

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

editSubscribe (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 ?

Categories:
  • awad Profile Picture
    awad 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
    awad 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
    Community Member UG Leader 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
    Inogic 23,915 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
    Tim Dutcher 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

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,045 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,570 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans