Note that there are some explanatory texts on larger screens.

plurals
  1. POCRM 2013 Dynamic OptionSet issue
    primarykey
    data
    text
    <p>I am using CRM 2013 On premise, and in it there is an attribute which has an option set (not global) having text and value as "Dummy Entry" "0". Default Value is unassigned.</p> <p>My code is to add options in this option set with some business logic. So I can add new options in it via Javascript.</p> <p>When I am adding Options in it via Javascript, it is not allowing me to change the value lets say</p> <p>Option1 val1 Option2 val1 is added then it wont allow me to select these values and every-time selecting them will revert to default entry "--" and nothing will change.</p> <p>But lets say I add "Option1" "0" "Option2" "0"</p> <p>as text and values, they are shown finely and selecting any of them changes the text to "Dummy Entry". </p> <p>Basically somehow if the value exists in the list of Options (which are static and not added via JS), it is accepting and selecting it and showing text from it.</p> <p>If the value is not found in the static option list, it doesnt select anything and show default "--"</p> <p>I hope I am clear, please let me know in case of any confusion. The following snippet is working in CRM 2011 while not working in CRM 2013.</p> <pre class="lang-js prettyprint-override"><code>// testing function populateBundleLists: function () { var bundleListControl = Xrm.Page.getControl("XXX_bundlelist"); var bundleOptions = bundleListControl.getAttribute().getOptions(); var bundleOption = bundleOptions[0]; bundleListControl.clearOptions(); // add some arbitrary values to control for (var i = 1; i &lt;= 7; i++) { bundleOption.value = i; bundleOption.text = 'Dummy bundle ' + i.toString(); bundleListControl.addOption(bundleOption, i - 1); } }, </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload