我正在尝试处理 MS CRM 2011 中的选项列表,但它无法正常工作。实际上,我在选择列表中有 5 个参数,但这段代码只有 2 个。
function InstOwnerPickListOnLoadStage()
{
lSub = Xrm.Page.getControl("new_status");
lSub.originalPicklistValues = lSub.getAttribute().getOptions();
lKAZNACHOptionList = new Array();
lRISKIPolOptionList = new Array();
lKAZNACHOptionList .push(0,1);
lRISKIPolOptionList .push(2,3);
document.FillPicklist = function (iDesiredOptions)
{
for (var i=0; i< lSub.originalPicklistValues.length; i++)
{
for (var j=0; j< iDesiredOptions.length; j++)
{
if(iDesiredOptions[j] == i)
{
lSub.addOption( lSub.originalPicklistValues[i]);
break;
}
}
}
}
var optionset = Xrm.Page.ui.controls.get("new_status");
optionset.clearOptions();
document.FillPicklist(lKAZNACHOptionList );
//InstOwnerPickListOnChangeStage(null);
}