Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

upsert for Enterprise Toolkit broken #1

Closed
evandonovan opened this issue Dec 6, 2010 · 5 comments
Closed

upsert for Enterprise Toolkit broken #1

evandonovan opened this issue Dec 6, 2010 · 5 comments

Comments

@evandonovan
Copy link

the upsert call for the Enterprise Toolkit is still broken.

It should be something like the following:

  /**
* 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
* @param string $type The type of objects being upserted.
* @return UpsertResult
*/
  public function upsert($ext_Id, $sObjects, $type = 'Contact') {
    $arg = new stdClass;
    $arg->externalIDFieldName = new SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
    foreach ($sObjects as &$sObject) {
      $sObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace);
    }
    $arg->sObjects = $sObjects;
    return parent::_upsert($arg);
  }

See https://github.com/messageagency/salesforce/blob/master/soapclient/SforceEnterpriseClient.php for an example.

@ghost
Copy link

ghost commented Dec 23, 2010

Hi Evan - your patch looks good - thanks! I'll do a quick test and commit the change asap. BTW - you didn't fork this project to create yours, did you? I can't see a way to pull the change over in github...

@ghost
Copy link

ghost commented Dec 23, 2010

Patch tested and committed - a12095f

@evandonovan
Copy link
Author

Thanks! We will be unforking soon, then, as per http://drupal.org/node/1016488.

@evandonovan
Copy link
Author

Our fork wasn't an actual Github fork, btw, since I don't think that you had released the Github version yet.

@ghost
Copy link

ghost commented Jan 11, 2011

Thanks for the update, Evan.

As I mentioned in the Force.com blog entry (http://blog.sforce.com/sforce/2011/01/get-social-with-the-forcecom-toolkits-at-github.html), please do feel free to fork and make changes, that's (partly) why we're here at GitHub now, but, equally, if we are all in the same GitHub tree, it's super easy to pull your patches in :-)

dcarroll pushed a commit that referenced this issue Mar 16, 2017
Array key references break argument processing
isdr-jonathan-pike pushed a commit to newswirecom/Force.com-Toolkit-for-PHP that referenced this issue Jun 13, 2023
Update SforceEnterpriseClient.php
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant