1

我搜索解决方案以在新的查找快速查找中添加特定过滤器。

问题特定于customerid查找类型,因为这使用了在同一查找中包含帐户和联系人的“客户”类型(这是新的多实体查找)

我使用此查找帐户和联系人,并且只想过滤来自特定帐户的联系人。

我尝试另一种更改它的方法是更改​​ html 对象但没有成功。

这里是具体查找的html数据。

lookuptypesnames 和 createpermissiondictionary 包含帐户和联系人,如果我更改为我提供联系人的 lookuptype=1。

然后我搜索一种本地方式来更改特定实体上的 customerid 查找(仅在联系人上),不想使用 jquery 功能。

4

3 回答 3

1

这就是我为设置客户查找以仅显示联系人记录所做的工作。

function Form_OnLoad()
...
preFilterLookup();
..
}


function preFilterLookup() {
Xrm.Page.getControl("customerid").addPreSearch(addLookupFilter);
}

function addLookupFilter() {

document.getElementById("customerid_i").setAttribute("lookuptypenames", "contact:2:Contact");
document.getElementById("customerid_i").setAttribute("lookuptypes", "2");

var account = Xrm.Page.getAttribute("aux_account").getValue();

if (account != null) {

    var filter = "<filter type='and'>" + "<condition attribute='parentcustomerid' operator='eq' value='" + account[0].id + "' /></filter>";
    Xrm.Page.getControl("customerid").addCustomFilter(filter);
}
于 2014-09-02T16:36:43.697 回答
1

你应该使用setLookupTypes.

像这样的东西:

 var owner = Xrm.Page.getAttribute("ownerid").getLookupDataAttribute();        
 owner.setLookupTypes(["systemuser"]); 
于 2019-08-23T11:48:28.570 回答
0

如果帐户控制是查找,那么您的 fetchXml 应该是

fetchXml = "<filter type='and'><condition attribute='parentcustumerid' operator='eq' uitype='contact' value='" + account[0].id + "' /></filter>";

于 2013-12-05T14:25:14.670 回答