您的位置:首页 > 其它

CRM 2016 自定义lookup过滤

2016-09-18 09:44 288 查看
function preFilterLookup() {
//终端业态
Xrm.Page.getControl("new_typeofoperationid").addPreSearch(function () {
addLookupFilter();
});
}
function addLookupFilter() {
var customertypecode = Xrm.Page.getAttribute("customertypecode").getValue(); //客户类型
if (customertypecode != null) {
fetchXml = "<filter type='and'><condition attribute='new_customertypecode' operator='eq' value='" + customertypecode + "' /></filter>";
Xrm.Page.getControl("new_typeofoperationid").addCustomFilter(fetchXml);
}
}


以上代码指在实现,以下功能:

1 当选择客户类型时,自动按选择后的 客户类型去过滤 终端业态这个lookup.

2 这两个函数应该放在 客户类型的onchange事件中比较好.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: