public function RestClientInterface::objectUpsert in Salesforce Suite 8.3
Same name and namespace in other branches
- 8.4 src/Rest/RestClientInterface.php \Drupal\salesforce\Rest\RestClientInterface::objectUpsert()
- 5.0.x src/Rest/RestClientInterface.php \Drupal\salesforce\Rest\RestClientInterface::objectUpsert()
Create new records or update existing records.
The new records or updated records are based on the value of the specified field. If the value is not unique, REST API returns a 300 response with the list of matching records and throws an Exception.
Parameters
string $name: Object type name, E.g., Contact, Account.
string $key: The field to check if this record should be created or updated.
string $value: The value for this record of the field specified for $key.
array $params: Values of the fields to set for the object.
Return value
\Drupal\salesforce\SFID The new object's SFID, if created. NULL if updated. This is not ideal, but this is how Salesforce's API works. Go upvote this idea to fix it:
1 method overrides RestClientInterface::objectUpsert()
- RestClient::objectUpsert in src/
Rest/ RestClient.php - Create new records or update existing records.
File
- src/
Rest/ RestClientInterface.php, line 480
Class
- RestClientInterface
- Objects, properties, and methods to communicate with the Salesforce REST API.
Namespace
Drupal\salesforce\RestCode
public function objectUpsert($name, $key, $value, array $params);