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

Using lead assignment rules when inserting new lead records
I've been doing some reading and I think I'm *almost* there. I'm
doing the following to attempt to use the lead assignment rules, but it
isn't working -- I get NULL results.
$leadassign = new soapval('autoAssign', 'boolean', 'TRUE');
$contact = new sObject('Lead',
null,
array(
'salutation' => $_POST['salutation'],
'FirstName' => $_POST['first_name'],
'LastName' => $_POST['last_name'],
'Company' => $_POST['company'],
'email' => $_POST['email'],
'LeadSource' => $_POST['lead_source'],
'Street' => $_POST['street'],
'City' => $_POST['city'],
'State' => $_POST['state'],
'Phone' => $_POST['phone'],
'PostalCode' => $_POST['zip'],
'Country' => $_POST['country'],
'MobilePhone' => $_POST['mobile'],
$leadassign )
);
$createResult = $sfdc->create($contact);
print_r("\ncreate one: \n\n");
print_r($createResult);
Thanks for any help!!
Chuck
$leadassign = new soapval('autoAssign', 'boolean', 'TRUE');
$contact = new sObject('Lead',
null,
array(
'salutation' => $_POST['salutation'],
'FirstName' => $_POST['first_name'],
'LastName' => $_POST['last_name'],
'Company' => $_POST['company'],
'email' => $_POST['email'],
'LeadSource' => $_POST['lead_source'],
'Street' => $_POST['street'],
'City' => $_POST['city'],
'State' => $_POST['state'],
'Phone' => $_POST['phone'],
'PostalCode' => $_POST['zip'],
'Country' => $_POST['country'],
'MobilePhone' => $_POST['mobile'],
$leadassign )
);
$createResult = $sfdc->create($contact);
print_r("\ncreate one: \n\n");
print_r($createResult);
Thanks for any help!!
Chuck
$useDefaultRule = new soapval('useDefaultRule', null, 'true');
$sfdc->setHeader('AssignmentRuleHeader', array($useDefaultRule));
hi,
your code doesn't work for me. the first thing: I only found setHeaders() method and not setHeader() which was private in the SForceBaseclinet.php so I had to change it to public.
After then, lead creating gives me the error 'Invalid SOAP Header'
Is anything else I have to set up in my code??
thanks
this link helped me out:
http://code.google.com/p/force-com-php-toolkit/source/browse/trunk/unit_test/Lib/Test/Partner/AssigmentRuleHeaderTest.php?r=4&spec=svn4