//隐藏字段属性
Javascript – Control OptionSet values | Microsoft Dynamics 365
removeOption (Client API reference) in model-driven apps - Power Apps | Microsoft Docs
formContext.getControl(arg).removeOption(value);
function OptionSetValueOnload(){
var optionSetValueList = Xrm.Page.getAttribute("new_hobby").getOptions();
for (var i in optionSetValueList)
{
if (optionSetValueList[i].text == "RAP")
{
Xrm.Page.getControl("new_hobby").removeOption(optionSetValueList[i].value);
}
}
}