Text Scroll

You must welcome, Thank you for visiting my blog.

Search This Blog

Monday, July 6, 2020

Retrieve and set LookUp value in MS CRM

Set Lookup value
--------------------------------------------------------------

var BUlookupVal = new Array();                      
      BUlookupVal[0] = new Object();
      BUlookupVal[0].id = GUID;
      BUlookupVal[0].name = Value;
      BUlookupVal[0].entityType =_entity logical name;                       
Xrm.Page.getAttribute("fieldname").setValue(BUlookupVal);


Retrieve Lookup Value
---------------------------------------------------------------

var LKName = Xrm.Page.getAttribute("Lookup_fieldname").getValue();
 var LkId = LKName .id;
var LKname = LKName.name;
var LKtype = LKName.entitytype;

No comments:

Post a Comment