Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Web API - Set regarding on appointment

$
0
0

I'm running into difficulties using the new Dynamics Web API rest endpoint when trying to set regarding on an appointment. Has anyone successfully done this? Firstly, I struggled to figure out how to set the regarding directly on the entity and post it as part of the create. If you know how to do it this way I'd love an example.

The other way (updating a single-valued navigation property) from this page (https://msdn.microsoft.com/en-us/library/mt607875(v=crm.8).aspx#bkmk_Changethereferenceinasingle) you can see see that a PUT should be available, but the example is for an opportunity:

PUT [organization URI]/api/data/v8.0/opportunities(00000000-0000-0000-0000-000000000001)/customerid_account/$ref HTTP/1.1

Next, looking at this page (https://msdn.microsoft.com/en-us/library/mt593026.aspx#bkmk_SingleValuedNavigationProperties) I can see that the single-valued navigation properties on appointment include this "regardingobjectid_account". So I would expect to be able to do this:

https://[organization URI]/api/data/v8.0/appointments(00000000-0000-0000-0000-000000000002)/regardingobjectid_account/$ref?

with an odata.id set in the payload to something like:

https://[organization URI]/api/data/v8.0/accounts(6DBE6556-CA99-E511-80D5-6C3BE5BECDB4)

But it throws back a "400 bad request":

Error: Status Code:400 The target Entity Set of Navigation Property 'regardingobjectid_account' could not be found. This is most likely an error in the IEdmModel.

What am I doing wrong?




Viewing all articles
Browse latest Browse all 1000

Trending Articles



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