Announcements
Hello,
We are trying to programatically add options to a multi select option set in Dynamics 365, using JavaScript.
The below code snippet works fine in the old web interface, but in the Unified Interface we are getting the following error:
TypeError: Xrm.OptionSetItem is not a constructor
Has anyone enountered this issue before and knows a workaround? In this scenario we are unable to remove select options in the code, due to the amount of options available.
This also begs the question, do certain JavaScript methods only work in the old web client?
You can do the following >
var label = "something ";
var value = "9000001";
var xrmOptions = null ;
if (Xrm.Internal.isUci()) {
xrmOptions = {
"text": label.trim(),
"value": value.trim())
};
}
else {
xrmOptions = new Xrm.OptionSetItem(label.trim(), value.trim());
}
optionSetCtrl.addOption(xrmOptions, [position value])
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator