询问者
crm2011中,如何把客户和联系人关联到自定义的实体的一个字段上。

问题
全部回复
-
Partylist字段是系统内置的一种类型,无法通过属性编辑器进行配置。可以通过创建两个字段的方式完成。
如果是CRM 4.0,那么可以参看我写的文章:http://www.cnblogs.com/StoneGarden/archive/2011/08/31/2160769.html
daemon lin
-
仅根据你的需要,可以通过JS中动态改变LOOKUP的类别:
var contactEntity = GetEntityAttribute("contact", "parentcustomerid", "contactid", ctiurl[0]);
if (contactEntity.length > 0) {
// 反查客户并给赋值
var olookup = new Object();
olookup.id = contactEntity[0].text;
olookup.entityType = contactEntity[0].attributes[1].value;
olookup.name = contactEntity[0].attributes[0].value;
var olookupValue = new Array();
olookupValue[0] = olookup;
Xrm.Page.getControl('new_account').getAttribute().setValue(olookupValue);
}
}
else if (ctiurl[2] == "account") {
// 反查客户并给赋值
var olookup = new Object();
olookup.id = ctiurl[0];
olookup.entityType = ctiurl[2];
olookup.name = ctiurl[1];
var olookupValue = new Array();
olookupValue[0] = olookup;
Xrm.Page.getControl('new_account').getAttribute().setValue(olookupValue);
}