I want to create new record(entity-name: mb_myEntity) with following fields using JavaScript in html form.
Field logical Name | Field Type | |
mb_name | single text | |
mb_case | Lookup |
I am unable to created records along with lookup field. Please suggest if i'm doing some mistake, here is the code for creating record
var data =
{
"mb_name": document.getElementById("name").value,
"mb_case@odata.bind": "incident(FB4F88B0-XXXX-XX)"
}
parent.Xrm.WebApi.createRecord("mb_myEntity",data).then(
function success(result){
alert(result.id);
},
function (error){}
);
Note: without setting up case lookup, this code is creating new record.
*This post is locked for comments