Wednesday, 18 May 2016

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


 Set the value of a lookup field


var lookup = new Array();
lookup[0] = new Object();
lookup[0].id = recorid;
lookup[0].name = recordname;
lookup[0].entityType = entityname;
Xrm.Page.getAttribute("fieldSchemaname").setValue(lookup);

Alternate way to Set the value of a lookup field




Xrm.Page.getAttribute("fieldSchemaname").setValue([{ id: recorid, name: recordname, entityType: entityname}]);

No comments:

Post a Comment