I create a lead form going through this Customize | Leads | Web-to-Lead.
I want to submit this form through soap api.
I use code given in below link on salesforces developer.
https://developer.salesforce.com/page/PHP_Toolkit_13.0_Create_Delete_Undelete_Sample_(Enterprise)
Code:
define("SOAP_CLIENT_BASEDIR", "soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');
require_once ('userAuth.php');
try {
$mySforceConnection = new SforceEnterpriseClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
$mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
$sObject = new stdclass();
$sObject->first_name = 'Smith';
$sObject->last_name = 'John';
$sObject->company = 'hashe';
$sObject->email = 'anjum@hashehouse.com';
$sObject->city = 'lahore';
$sObject->state = 'punjab';
$sObject->street = 'ts 3 g';
$sObject->zip = '54400';
$sObject->country = 'pakistan';
$sObject->description = 'This is just for testing ';
echo "**** Creating the following:\r\n";
$createResponse = $mySforceConnection->create(array($sObject), 'Lead');
print_r($createResponse);
} catch (Exception $e) {
echo $mySforceConnection->getLastRequest();
echo $e->faultstring;
}
I am receiving following error:
Error is "INVALID_FIELD: No such column 'first_name' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.