You need to sign in to do that
Don't have an account?

External IDs and "upsert" in PHP
Hello,
We're using the following bit of code (not exhaustively provided here) to upsert a Lead. The resulting error states the external ID does not exist. We have created a custom field for Leads called "emailid" in the account to which this code is attempting to upsert the Lead. Any ideas why this is not working?
$sObject = new SObject();
$sObject->fields=$FIELDS;
$sObject->type=$data["salesforce_type"];
$sObject->emailid=$data["email"];
$sfresults=$client2->upsert('emailid',array($sObject));
Perhaps something as simple as a working example using real strings (vs variables) would provide all the direction we need to get this working.
Thanks,
-Ben
ii) custom fields names end in __c, so you should be referering to the field as emailid__c
ii) custom fields names end in __c, so you should be referering to the field as emailid__c
Thanks. It actually was working, but returning a different error which we were able to resolve.
I recall reading in documentation that in order to use upsert, a custom field must be created and marked as an external ID. So the question is this: Is there no way to use the default and existing e-mail field without having to make any modifications? If not, how will changes be made to the accounts of every user who uses our system?
Also, is there a way to send a bulk upsert to reduce the number of calls to SF?