Hi to all,
I have some doubts that CRM has some restrictions on Web API functions on call. Let me introduce briefly.
I can create a record in my custom entity with below-stated parameters without error.
var dataCamp =
{
"new_name": "Test Title",
"new_AccountId@odata.bind": "/accounts("86F10EB5-09E4-E811-A94F-000D3AB6413D)",
};
Xrm.WebApi.createRecord("new_testentity", dataCamp).then(
...
But when I want to create a record on OOB - Campaign Response then I have got an error.
var dataCamp =
{
"subject": Test Title,
"regardingobjectid_campaign@odata.bind": "/campaigns(" + campaignId + ")",
"new_AppointmentId@odata.bind": "/appointments(fd288fdd-abe8-e811-a950-000d3ab6488a)"
};
Xrm.WebApi.createRecord("new_testentity", dataCamp).then(
...
Error Message is: An undeclared property 'new_AppointmentId' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.
I have all controlled; schema name of lookup, relations, and the name of the relations from .XML files and nothing is wrong.
The funny part is: I can create a "Campaign Response" with Regarding lookup if I remove the new custom lookup on my query)
So you dear guys and ladies, could you please check my upper statements to prevent some missing points?
If you can try in your system especially on Campaign Response to create, it would be so great to compare.
Thanks in advance, Seren.