crm dynamices365 前台js,下拉框值的移除,添加
//循环隐藏
var industryremove = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
var controls = Xrm.Page.getControl(“st_industry”);
for (var i = 0; i < industryremove.length; i++) {
controls.removeOption(industryremove[i]);
}
//循环显示
var industryAdd = [{ value: 1, text: “出版社” }, { value: 5, text: “广告公司” }, { value: 6, text: “杂志社” }, { value: 7, text: “报社” }, { value: 8, text: “超市” }, { value: 9, text: “大型企业或其他” }]
var controls = Xrm.Page.getControl(“st_industry”);
for (var i = 0; i < industryAdd.length; i++) {
controls.addOption(industryAdd[i]);
}