Attached patch replaces the if/else create/update workaround with Salesforce's idempotent upsert method.
From the documentation:
/**
* Creates new objects and updates existing objects; uses a custom field to
* determine the presence of existing objects. In most cases, we recommend
* that you use upsert instead of create because upsert is idempotent.
* Available in the API version 7.0 and later.
*
* @param string $ext_Id External Id
* @param array $sObjects Array of sObjects
* @return UpsertResult
*/
public function upsert($ext_Id, $sObjects)
| Comment | File | Size | Author |
|---|---|---|---|
| salesforce-upsert.patch | 1.98 KB | aaronbauman |
Comments
Comment #1
Anonymous (not verified) commentedPatch applied fine on latest development version. Upsert worked as expected.
Comment #2
aaronbaumanhttp://drupal.org/cvs?commit=330898