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 :
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

I have the same question (0)
  • Verified answer
    Tim Dutcher Profile Picture
    2,100 on at

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

  • Verified answer
    Inogic Profile Picture
    703 on at

    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
    Community Member Profile Picture
    on at

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

    as per onchange event use fireonchange as suggested by Tim Dutcher

  • awad Profile Picture
    on at

    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.

  • awad Profile Picture
    on at

    Hi Team,

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

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans