i want to retrieve lookup record name if another field value change
here is my scenario i have a look up field called candidate and another field name send-email type(two option field yes\no )when user click on send-email a message will pop up with the candidate name\id and entity type \here is what i have found and write.
function getLookupDetails() {
var lookupObj = Xrm.Page.getAttribute(ant_candidate); //Check for Lookup Object
if (lookupObj != null) {
var lookupObjValue = lookupObj.getValue();//Check for Lookup Value
if (lookupObjValue != null) {
var lookupEntityType = lookupObjValue[0].entityType, //To get EntityName
lookupRecordGuid = lookupObjValue[0].id, // To get record GUID
lookupRecordName = lookupObjValue[0].name; //To get record Name
if (lookupEntityType != null && lookupRecordGuid != null && lookupRecordName != null) {
Xrm.Utility.alertDialog("Entity Type : " + lookupEntityType + "\nRecord GUID : " + lookupRecordGuid + "\nRecord Name : " + lookupRecordName, null);
}
}
}
}
i got an error here is the error ReferenceError: getLookupDetails
please help Best Regards .
*This post is locked for comments