jetstreamapp / jetstream

A better way to work on Salesforce
https://getjetstream.app/
Other
77 stars 18 forks source link

Add support for updateOnly option for data loads using Batch upserts #941

Open paustint opened 2 months ago

paustint commented 2 months ago

Describe the problem you are trying to solve

With API version 61.0, UPSERT requests using REST API can opt to fail instead of creating a new record. This would be a nice option to expose to users when using the Batch API.

https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/resources_sobject_upsert_patch.htm https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/resources_composite_sobjects_collections_upsert.htm

https://help.salesforce.com/s/articleView?id=release-notes.rn_api_new_updateonly_param.htm&release=250&type=5

Update Records Using External IDs in REST API

You can now update a record using the value of its external ID with the new updateOnly parameter in REST API. Previously, you could only upsert a record using its external ID.

Where: This change affects API version 61.0 and later.

How: To prevent creating a new record if the target record can’t be found or doesn’t exist, add the updateOnly parameter to a URL that executes an upsert operation. You can also use URLs with the updateOnly parameter in composite REST API and composite graph REST API.