When updating records in Dynamics 365 CRM using the OData API, it's essential to follow the correct structure for binding properties. The field names and target entities are derived from the navigation binding values found in the $metadata endpoint.
-
Locate the field you wish to update:
-
Field Names and Navigation Bind Values:
-
Each field that you want to update in the CRM must correspond to a navigation property defined in the
/$metadata
document. This document provides the schema for the entities and their relationships. -
The navigation property names (such as
parentsystemuserid
,mercury_PrimaryTeamId
, etc.) are used in the payload to identify the fields being updated. Below we see the Path and Target values. Path will be used for the fieldname and Target will be used in the value.
-
-
Example JSON Payload Structure:
-
When creating the payload for a PATCH or POST request, use the navigation property names followed by
@odata.bind
to bind the field to a specific record in another entity. For example: -
{ "parentsystemuserid@odata.bind": "systemusers(5ea2c3ef-1bf8-ee11-a1ff-00224800406a)", "mercury_PrimaryTeamId@odata.bind": "teams(418b7701-0bf6-ee11-a1ff-0022481b5893)"}
{ "mercury_PrimaryTeamId@odata.bind": null <--- This is an example of setting a value to null}
-
Datablend Example:
-
id is the target record. The id field is only required if Updating or Deleting. Not required for creating new records.
-
Push Payload and 204 success response: