+ Start a Discussion
needdevhelpneeddevhelp 

No Error, but no Lead

I've finally managed to succesfully create a new lead programatically.
 
The result string shows this: "Object id #9"
it doesn't look like an error but the new lead doesn't show up in salesforce.
 
Am I missing a step?
 
SuperfellSuperfell
I think you missed a semi-colon on line 10.

A little more context will probably be required for anyone to give you any useful tips.
A call to create returns a saveResult which includes the id of the newly created object, or an error reason why that particular object couldn't be created. nothing would say Object id #9
needdevhelpneeddevhelp

Hmm...  well, first I login and that has no issues. Then I create an array of field values and here is how I'm creating the lead:

Code:

$lead = array(
    'FirstName' => $firstname,
    'LastName' => $lastname,
    'Title' => $title,
    'Email' => $email,
    'Street' => $street

);
try {
  $addLeadResult = $sfdc->create("lead", $lead);
  echo $addLeadResult;
} catch (Exception $e) {
  global $errors;
  $errors = $e->faultstring;
  echo "Error Creating Lead: " . $e->faultstring . "<br/>";
}


 When this runs the output from the "echo $addLeadResult;" is "Object id #9".  I had plenty of errors getting this far so I know what the error messages look like.  This to me looks like success, but the new lead doesn't show up in Salesforce. 

Can you see anything I'm doing wrong?

SuperfellSuperfell
$addLeadResult is a structure that tells you if it succeeded or not. the folks on the php section will more likely be able to help you access it.