function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
needdevhelpneeddevhelp 

Create with Custom fields

I'm working with PHP5 and the Partner API.  I'm creating a lead through the API and so far it's working with the standard fields, but none of the custom fields work.  I thought I had read that I could use the custom fields by name but that didn't work so I used the ugly names "00234239847" and that gives me this error:
 
The content of elements must consist of well-formed character data or markup.
 
I read in another forum that this was taken care of, but it still seems to be a problem.
 
any help will be appreciated.
regards
Tran ManTran Man
This worked for me:

Code:
  $createFields = array (
    'FirstName' => 'First',
    'LastName' => 'Last',
    'Company' => 'Test Co',
    'SICCode__c' => '9999',
  );
  $createResponse = $mySforceConnection->create('Lead', $createFields);
  print_r($createResponse);
where SICCode__c is my custom field.  Try printing out the createResponse.
 

needdevhelpneeddevhelp

Thanks,

The "__c" for custom fields works perfeclty.  I can't find that anywhere in the documentation.  It would be nice if it were in there.

SuperfellSuperfell
The valid list of fieds for your login are available via the describeSobject call, which will include the __c suffix for custom fields.