Xrm.Page.ui clearOptions and addOption not working in Dynamics 2013 online

Question Status

Suggested Answer
justasd asked a question on 17 Oct 2013 6:13 AM

Is there a working alternative to Xrm.Page.ui clearOptions and addOption in Microsoft Dynamics 2013 online?

Reply
Guido Preite responded on 17 Oct 2013 6:50 AM

Hi,

that are supported methods, it's strange they are not working, can you share your javascript code to check if all is ok?

Reply
justasd responded on 17 Oct 2013 7:09 AM

The JavaScript code is here:

http://pastebin.com/Wm9PcvWF

It is taken from sample provided by Microsoft and is used for creating Dependent OptionSets:

msdn.microsoft.com/.../gg594433.aspx

This code works fine on MS Dynamics online based on 2011, but alerts ("undefined") in CRM 2013.

The code breaks on line 40: controls[ctrl].clearOptions();

I am trying to solve this problem, but with no luck

Reply
Andrea F. responded on 8 Nov 2013 12:18 AM

I'm sorry, is there any update to this question? Thanks.

Reply
DanAl responded on 18 Nov 2013 2:10 PM

I am also having the same problem. Any update to this issue?

Reply
Suggested Answer
Ashwani Kumar responded on 27 Apr 2014 9:20 AM

Hello Everyone,

I too came across this issue recently and figured out a workaround to this. I've blogged it here:-

ashwaniashwin.wordpress.com/.../this-get_editview-is-null-or-not-an-object-error-during-jscript-controls-clearoptions-in-crm-2013

Hope this helps.

Reply
JorgeM responded on 21 May 2014 1:34 PM

Here is a solution that works fine.

If you use this solution, you need to make sure to check the "Pass Execution context as first parameter" checkbox on the Function SDK.DependentOptionSet.init on your form.

ggoulf.blogspot.mx/.../how-to-solve-problem-of-dependent.html

Reply
Suggested Answer
Ashwani Kumar responded on 27 Apr 2014 9:20 AM

Hello Everyone,

I too came across this issue recently and figured out a workaround to this. I've blogged it here:-

ashwaniashwin.wordpress.com/.../this-get_editview-is-null-or-not-an-object-error-during-jscript-controls-clearoptions-in-crm-2013

Hope this helps.

Reply