Newer Version Available
Update Records Using sObject Relationships
Updates a record based on the specified object, record ID, and relationship field
name. Field values provided in the request body replace the existing values in the
record.
If the fields parameter is used with fields that don’t exist or aren’t visible to the consumer by field-level security, a 400 error response is returned. For other error messages, see Status Codes and Error Responses.
Syntax
- URI
- /services/data/vXX.X/sobjects/sObject/id/relationshipFieldName
- Formats
- JSON, XML
- HTTP Method
- PATCH
- Authentication
- Authorization: Bearer token
- Parameters
-
Parameter Description sObject The name of the object. For example, Account.
id The identifier of the record. For example, 001R0000005hDFYIA2.
relationshipFieldName The name of the field that contains the relationship. For example, Opportunities.
Example
For an example of updating a record using PATCH, see
Update a Record.