+ Reply to Thread
Results 1 to 3 of 3

Thread: Upsert Record(s) related to other Objects

  1. #1
    quantentunnel is offline Junior Member
    Join Date
    Feb 2010
    Posts
    4

    Upsert Record(s) related to other Objects

    Hi,
    after searching for hours I would like to ask how you do upsert/create records containing lookup-fields to objects with theire own external ID.

    e.g.: Contact has its own external ID = Contact_ext_ID__c
    Account has its own external ID = Acc_ext_ID

    I would like to upsert contacts like this
    Contact_ext_ID__c = "23523AG",
    Account.Acc_ext_ID__c = "A540065" //can't get this field matching during upsert/create
    Info__c = "Prospect"
    Name = "Mike",
    City = "Hollywood";


    best regards

    UPDATE: There is another thread that is not really solved in PHP: Setting a lookup field using an External ID in UPSERT
    Last edited by quantentunnel; 02-18-2010 at 08:49 AM.

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    557
    Blog Entries
    15
    Maybe I am not understanding you fully, but it seems what you are trying to do is not possible. If you have an external ID set on Accounts, then you have to use that external ID to upsert to that object. Same goes for contacts or any other object. Now if I am wrong with your question, please be more clear and I am sure that I can help you out

    Thanks for joining the site!!

    ~Mike

  3. #3
    Willis's Avatar
    Willis is offline Administrator
    Join Date
    Feb 2010
    Location
    Sunnyvale, CA
    Posts
    17
    Blog Entries
    9
    Quote Originally Posted by quantentunnel View Post
    Hi,
    after searching for hours I would like to ask how you do upsert/create records containing lookup-fields to objects with theire own external ID.

    e.g.: Contact has its own external ID = Contact_ext_ID__c
    Account has its own external ID = Acc_ext_ID

    I would like to upsert contacts like this
    Contact_ext_ID__c = "23523AG",
    Account.Acc_ext_ID__c = "A540065" //can't get this field matching during upsert/create
    Info__c = "Prospect"
    Name = "Mike",
    City = "Hollywood";


    best regards

    UPDATE: There is another thread that is not really solved in PHP: Setting a lookup field using an External ID in UPSERT
    Hi Quant,

    You can do this it just might require two steps. You can't use two external IDs for one upsert which is why Account.Acc_ext_ID__c = "A540065" won't work.

    In order to do this, you can use your existing detail but make the Account.Acc_ext_ID__c the Salesforce.com generic AccountID from the Contact Object.

    In this case, you can keep your data structure and populate your external ID to the contact and then use the AccountID to associate it with the proper account.

    Because you have an external ID for the account, I would assume that you could simply export your current Account table with the external ID and then use a vLookup to match that against your upsert file.

    I hope this helps!

+ Reply to Thread

Similar Threads

  1. how to search on multiple objects
    By jlowtek in forum Salesforce PHP Tutorials
    Replies: 3
    Last Post: 08-04-2009, 08:01 AM
  2. How do I select one record and display the result
    By eliana in forum Salesforce Coding Discussions
    Replies: 13
    Last Post: 05-23-2009, 09:08 AM
  3. Salesforce PHP script which lists all Objects and Fields
    By mike in forum Salesforce PHP Tutorials
    Replies: 2
    Last Post: 03-27-2009, 01:14 PM
  4. Create Record on Custom Object using PHP
    By mike in forum Salesforce Coding Discussions
    Replies: 4
    Last Post: 11-06-2007, 03:19 PM

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.1