Does anyone have some code for setting the Lead Assignment Rule (or default rule) when creating a lead using the PHP API talking to version 4.0 sforce?
I am assuming your are using the PHP classes provided in the sForce repository. If so, you can do what I have done below as a means of using the rules you have in place for leads and or cases. If you intend to use rules all the time. This is found in the SalesforceClient.php file
function addSessionHeader() { $header = new SOAP_Header( '{urn:partner.soap.sforce.com}SessionHeader', NULL, array('sessionId' => $this->sessionId), 0); $this->addHeader($header);
Hi there,
I am assuming your are using the PHP classes provided in the sForce repository. If so, you can do what I have done below as a means of using the rules you have in place for leads and or cases. If you intend to use rules all the time. This is found in the SalesforceClient.php file
function addSessionHeader()
{
$header = new SOAP_Header(
'{urn:partner.soap.sforce.com}SessionHeader',
NULL,
array('sessionId' => $this->sessionId),
0);
$this->addHeader($header);
//For Testing
$ruleHeader = new SOAP_Header(
'{urn:partner.soap.sforce.com}AssignmentRuleHeader',
NULL,
array('useDefaultRule' => 'true'),
0);
$this->addHeader($ruleHeader);
}