Get Option Set selected Text and Value
var osTextValue = UpdateOptionSetCatA1.getAttribute().getText();
var osValue = UpdateOptionSetCatA1.getAttribute().getValue();
Disable/Hide an option set value
function UpdateOptionSet() { var UpdateOptionSetSchema = Xrm.Page.ui.controls.get("new_optionsetschema"); var osValue= UpdateOptionSetSchema.getAttribute().getValue(); if (osValue== null){ Xrm.Page.getControl("new_optionsetschema").removeOption('optionsetIntegerValue'); } if (osValue!= 'optionsetIntegerValue'){ Xrm.Page.getControl("new_optionsetschema").removeOption('optionsetIntegerValue'); } }