我可以获取联系人的ID,但是谁可以获取此联系人的电子邮件?
function getdata(){
var entityName, entityId, entityLabel, lookupFieldObject;
// parentaccountid is the lookup field name that we try to reach its values
lookupFieldObject = Xrm.Page.data.entity.attributes.get('mbmhr_employee');
if (lookupFieldObject.getValue() != null) {
entityId = lookupFieldObject.getValue()[0].id;
entityName = lookupFieldObject.getValue()[0].entityType;
entityLabel = lookupFieldObject.getValue()[0].name;
Xrm.Page.getAttribute("mbmhr_test22").setValue(entityLabel );
}
}
最佳答案
您需要查询服务器以获取相关记录的其他详细信息。
看一下Getting started with CRM 2011 JavaScript REST (OData) Web Service Calls和Retrieve Data using OData queries with Javascript in CRM 2013可以使您朝正确的方向前进。