type is a an optionset attribute. I dont want to use addoption as it will createa new optionset value everytime.
If(type==1)
{
show a,b;//a,b,c are values from another optionset
}
If(type==2)
{
show b,c;
}
*This post is locked for comments
type is a an optionset attribute. I dont want to use addoption as it will createa new optionset value everytime.
If(type==1)
{
show a,b;//a,b,c are values from another optionset
}
If(type==2)
{
show b,c;
}
*This post is locked for comments
No , its only client side changes and supported method . You can proceed in this way.
function OptionSetAddRemove() {
var optionSet = Xrm.Page.ui.controls.get("new_myoptionset");
var optionSetValues = optionSet.getAttribute().getOptions(); // retrieve All options of Option set field
optionSet.clearOptions();
optionSetValues.forEach(function (element) {
if (element.value == "831260009") // Add Options which you want to show based on value
optionSet.addOption(element);
if (element.value == "831260008") // Remove options which you want to hide based on value
optionSet.removeOption(element);
});
}
optionSet.addOption(element); // Will this not create a new optionset field value every time?
Hi,
In addition you can also follow below reference -
Using JS add/remove option-
community.dynamics.com/.../289497
dependent picklist -
arunpotti.wordpress.com/.../filter-optionsets-based-on-selection-in-ms-crm-using-javascript
Hello there,
Looks like you need dependent optionset functionality. If you are d365 - try to use out of the box dependent optionset feature www.trellispoint.com/dependent-option-sets-updated-dynamics-365
Otherwise In the SDK you have sample code of achieving this functionality docs.microsoft.com/.../gg594433(v=crm.8)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156