Instead of “typename” please use “entityType” as shown in the below code.
// contactid is the lookup field
lookupFieldObject = Xrm.Page.data.entity.attributes.get('contactid');
if (lookupFieldObject.getValue() != null) {
entityId = lookupFieldObject.getValue()[0].id;
entityName = lookupFieldObject.getValue()[0].entityType;
entityLabel = lookupFieldObject.getValue()[0].name;
}
Hope this help.
Thanks,
Sam
Inogic |
Blog | news@inogic.com
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"