Wednesday, 18 May 2016

How to Get the value of a lookup field using javascript in MS CRM


 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