Thursday 31 July 2014

CRM 2013 - Dependent OptionSets (picklists) error onchange

If you like me have downloaded the "Create dependent OptionSets (picklists)" code only to find it does not work in Chrome then never fear!

While i'd like to take responsibility for this fix, i actually found it here. http://ashwaniashwin.wordpress.com/2014/04/27/this-get_editview-is-null-or-not-an-object-error-during-jscript-controls-clearoptions-in-crm-2013/

However if you're lazy then the short answer is for some reason the option set list gets dropped in the following:-
for (var ctrl in controls) {
This means that when we call the following it doesn't exist.
controls[ctrl].clearOptions();
So as mentioned on the post above to fix this you can do the following:-
//controls[ctrl].clearOptions();
var childoptionset = Xrm.Page.ui.controls.get(childField);
childoptionset.clearOptions();
The Dependent OptionSets should now work as required!

1 comment:

  1. Thanks a lot, it was helpful. The Dependent OptionSets should now work with Outlook 2010 ! GREAT!

    ReplyDelete