Setting lookup field value its not simple way you have to set three parameters to set the lookup value those are follows –
- GUID of the lookup record
- Name of the lookup record
- Entity Name of the lookup which entity the lookup record is belongs to.
Here is sample code how to set the lookup value using JavaScript Dynamics CRM.
var lookupValue = new Array();
lookupValue[0] = new Object();
lookupValue[0].id = "{727504ed-64c5-4bc8-ac22-0a3071c427e3}"; // GUID of the lookup id
lookupValue[0].name = "Goutam Das"; // Name of the lookup
lookupValue[0].entityType = "contact"; //Entity Type of the lookup entity
Xrm.Page.getAttribute("FieldName").setValue(lookupValue); // You need to replace the lookup field Name..
Hope this helps :).

Like
Report
*This post is locked for comments