
I have a form on which there is a lookup.I want when a form load its value must be filled.I want to retrieve the records of this lookup and set one of the record on a form.
So i want odata query for this purpose.And query must not be Odata V4 because i have old version of crm.
*This post is locked for comments
I have the same question (0)Download the SDk, there are a lot sample on how to retrieve the data using REST. Check the follwoing directory SDK\SampleCode\JS\RESTEndpoint
here is a sample code that you can use
[View:https://dynamicscrmgirl.wordpress.com/2014/01/04/crm-2013-javascript-retrieve-record-using-odatarest-endpoint-without-jquery/:750:50]
Once you retrieve the record you want, use the follwoing code to set the value of lookup record.
Xrm.Page.getAttribute("attributename").setValue([{ id: recorid, name: recordname, entityType: entityname}]);
I hope this helps