Get the value of a lookup field
var lookupObject = Xrm.Page.data.entity.attributes.get("fieldSchemaname");
if(lookupObject!=null)
{
var lookUpObjectValue = lookupObject.getValue();
if(lookUpObjectValue!=null)
{
var lookupGuid=lookUpObjectValue[0].id;
var lookupName=lookUpObjectValue[0].name;
}
}
No comments:
Post a Comment