I have two entities: Exam Schedule and Exam. I am using Web API to create Exam record upon Exam Schedule field update. I am using following code:
var serverURL = Xrm.Page.context.getClientUrl();
var req = new XMLHttpRequest();
req.open("POST", encodeURI(serverURL + "/api/data/v8.0/new_examinations"), true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.onreadystatechange = function()
{
var accountUri = this.getResponseHeader("OData-EntityId");
};
var body=JSON.stringify({
"new_name": name,
});
req.send(body);
I have to set a lookup field on Exam. How can I set the lookup field?
*This post is locked for comments