+ Reply to Thread
Results 1 to 3 of 3
This is a discussion on Update Account within the Salesforce PHP Tutorials forums, part of the Salesforce category; Hopefully someone here can help. We are trying to synchronize accounts between
  1. #1
    drschultz is offline Junior Member
    Join Date
    Oct 2008
    Posts
    5

    Update Account

    Hopefully someone here can help. We are trying to synchronize accounts between salesforce.com and an internal system. Salesforce.com is the master, so when an account is created/edited i have an outbound message with account information sent to the internal system. That is working ok.

    Now i'm trying to initiate an upsert back to Salesforce.com with the unique ID for the internal system record. The problem is, what i really want to be able to do is "update the internal_system_id where the salesforce_id = x" - since the internal system ID is created after the salesforce account is created. I thought i could accomplish like this:
    Code:
    $results = $client->upsert("Id", $sObjects);
    This fails when i try to execute a test using this CSV file with one record:

    Code:
    "0018000000MuZf8AAF","48954_CA"
    "0018000000MuZf8AAF" is the salesforce ID & "48954_CA" is the internal system id.

    A var dump of $sObjects before the upsert looks like this:

    Code:
    array(1) {
      [0]=>
      object(SObject)#6 (3) {
        ["type"]=>
        string(7) "Account"
        ["fields"]=>
        array(2) {
          ["Id"]=>
          string(18) "0018000000MuZf8AAF"
          ["Customer_Code__c"]=>
          string(8) "48954_CA"
        }
        ["any"]=>
        string(72) "<Id>0018000000MuZf8AAF</Id><Customer_Code__c>48954_CA</Customer_Code__c>"
      }
    }
    The custom field "Customer_Code__c" is Text(8) (External ID) (Unique Case Insensitive).

    What am i doing wrong?

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    I will be able to look at my code from our upsert script on Monday and see if what i do can help you out David

    ~Mike

  3. #3
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    So David is this external Id the field that you are using to perform the upsert or are you using the Id to perform the upsert?

    From your emails and this post, it seems to me (AND PLEASE CORRECT ME IF I AM MISTAKEN) that your:

    1. Salesforce account object is the database of record, master
    2. Once an account is created it sends an outbound message to your application
    3. Your application then creates this unique id > Customer_Code__c
    4. You want to update the account in Salesforce with this locally system generated customer ID

    Am I correct in what you are trying to do?


    ~Mike

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.2