WEBAPI
difference between odata.id and odata.bind. Please explain me which is better and in what situation is used.
*This post is locked for comments
WEBAPI
difference between odata.id and odata.bind. Please explain me which is better and in what situation is used.
*This post is locked for comments
I think you need an extra put request to set the lookup, but you cannot use this format to export data:
Hi,
i have a question too.
We export dynamics365 crm data like that:
but the import with js-webapi9 needs the lookups not in this format:
{ "@odata.context": "assoffice.crm4.dynamics.com/.../v9.0$metadata#accounts(accountid,accountnumber,_parentaccountid_value)", "value": [ { "@odata.etag": "W/\"3179350\"", "accountid": "c42e134c-49ab-e711-a823-000d3a27889d", "accountnumber": "5555444444444", "_parentaccountid_value": "c42e134d-49cb-f711-b823-012d3a25889d" },
no, it needs Lookups in this format:
{ "@odata.context": "assoffice.crm4.dynamics.com/.../v9.0$metadata#accounts(accountid,accountnumber,_parentaccountid_value)", "value": [ { "@odata.etag": "W/\"3179350\"", "accountid": "c42e134c-49ab-e711-a823-000d3a27889d", "accountnumber": "5555444444444", "parentaccountid@odata.bind": "/accounts(ab822393-731c-e811-a84d-000d3a274ce0)" },
So - we need to export the data in the @odata.bind-Format. Then everything is fine.
Is this possible?
many thx.
PeB
Basically there is no general rule. The data model is the basis of an OData service. OData service uses an abstract data model called Entity Data Model (EDM) to describe the exposed data in the service. OData client can issue a GET request to the root URL of the OData service with $metadata to get an XML representation of the service’s data model.
The schema of the MS CRM Web Api is explained a bit here:
msdn.microsoft.com/.../mt607990.aspx
and can be downloaded here:
[Organization URI]/api/data/v8.2/$metadata
So Microsoft defined the schema of their model to request and retrieve data leaned on to the ODATA protocol that can be read on here:
odata.id is also used in associating records.So why is that used when odata.bind is available
With odata.bind you bind the URI (for a data record) to e.g. a lookup field in a web api request as explained here:
msdn.microsoft.com/.../mt770368.aspx
odata.id you usually retrieved from a response stream, for e.g. lookup field or a collection of records.
if you parse out the odata.id values you can use them in return to do further actions, e.g. sample above.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156