Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Not able to set lookup field value

$
0
0

Hello,
I am not able to set lookup field value when writing the below code. I am getting the error that "Uncaught ReferenceError:Xrm is not defined". I have also added XrmServiceToolkit and ClientGlobalContext.js.aspx but still getting the same error. Please provide the solution if possible.


var recordname = $("#SelectEntityPrimaryName").val();
var recordnamevalue = $("#SelectEntityPrimaryName option:selected").text();
	var primaryrecord = new Array();
	primaryrecord[0] = new Object();
	primaryrecord[0].id = recordname;
	primaryrecord[0].name = recordnamevalue;
	primaryrecord[0].entityType = "new_event";
Xrm.Page.data.entity.attributes.get("regardingobjectid").setValue(primaryrecord);



Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>