Announcements
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
Hi Team,
Please ignore my last comment. your responses resolved my issue.
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.
use this in your script Xrm.Page.ui.refreshRibbon();.
as per onchange event use fireonchange as suggested by Tim Dutcher
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
Calling the fireOnChange function for the field might resolve the issue. msdn.microsoft.com/.../gg334409.aspx
André Arnaud de Cal...
293,998
Super User 2025 Season 1
Martin Dráb
232,850
Most Valuable Professional
nmaenpaa
101,158
Moderator