You need to sign in to do that
Don't have an account?
n10ct
Adding Custom Fields and Upserts
We're closing in on integration with PE, but there still remains a couple of questions and a naming issue.
- How do we automatically add a custom field to accounts which use our program?
- Why must upsert connect with a custom field, vs. using the standard Email field as the external ID?
The issue we’re facing now is that the field names do not always work with upsert. For example, in contacts, there is a required field named “Name” which, when an upsert is attempted, returns the error “No such column 'Name' on entity 'contact'”. Is there an exhaustive list of true field names which work with upsert for every type (lead, contact, account)?
Thanks for letting me know the name change. The explorer did the trick.
Leads works properly with upsert as does Contacts. Accounts returns the following error:
Fatal error: Uncaught SoapFault exception: [soapenv:Client] '' is not valid for the type xsd:double in /home/landing/htdocs/new/sforce-php/soapclient/SforceBaseClient.php:526 Stack trace: #0 [internal function]: SoapClient->__call('upsert', Array) #1 /home/landing/htdocs/new/sforce-php/soapclient/SforceBaseClient.php(526): SoapClient->upsert(Object(stdClass)) #2 /home/landing/htdocs/new/salesforce/salesforce.php(130): SforceBaseClient->upsert('emailid__c', Array) #3 /home/landing/htdocs/new/index.php(118): salesforce(Array, Array) #4 {main} thrown in /home/landing/htdocs/new/sforce-php/soapclient/SforceBaseClient.php on line 526
All the code is the same as the other two, the fields are simply a different mapping as follows:
$FIELDS["account"]=array(
'Name'=>$data["fname"].' '.$data["lname"],
'AnnualRevenue'=>$data["annualrevenue"],
'Phone'=>$data["phone"],
'Fax'=>$data["fax"],
'Email'=>$data["email"],
'BillingStreet'=>$data["addr1"].' / '.$data["addr2"],
'BillingCity'=>$data["city"],
'BillingState'=>$data["state"],
'BillingPostalCode'=>$data["zip"],
'BillingCountry'=>$data["country"],
'Extra_Information__c'=>'',
'emailid__c'=>$data["email"]
);
I have no idea to what the error is referring. Any insights?