I have the following function to call attributes of the contact entity to the test entity in this case, where by comparison of a lookup field, I bring the data that I need, the problem is that the query only serves me for fields of type picklist and not type text.
function updateContact () {
var contactperson = Xrm.Page.getAttribute ("contactperson");
var account = contactperson.getValue () [0];
var processId = account.id.replace ("{", "") .replace ("}", "");
contactperson.addOnChange (function () {
var select = "emailaddress1, telephone1, MobilePhone" var filter = "Accountid eq guid'" + processId + "'"; $.getJSON(oDataEndpoint + "/ContactSet", { $filter: filter, $select: >>select }, function (data) { if (data != null && data.d != null) { >>Xrm.Page.getAttribute("emailaddress").setValue(data.d.results[0].emailaddress1); } });
}); }