You need to sign in to do that
Don't have an account?
Setting AssignmentRuleHeader in PHP toolkit
Hi All,
I need to create a case from the api and I have that part working but I need to set the AssignmentRuleHeader to use the defaul rules and I cant find any samples. I'm lot on where or how to set it in my code. I see the functions are there in php toolkit.
Any help would be great...been at it for a few hours.
Thanks!
$mySforceConnection = new SforcePartnerClient();
$mySforceConnection->createConnection(SF_WSDL);
$loginResult = $mySforceConnection->login(SF_USER_NAME, SF_PASSWORD);
try {
$createFields = array (
'Subject' => 'This is a test Case',
);
$sObject1 = new SObject();
$sObject1->fields = $createFields;
$sObject1->type = 'Case';
$createResult = $mySforceConnection->create(array (
$sObject1
));
echo "<br>Case: ".$createResult->id;
} catch (Exception $e) {
global $errors;
$errors = $e->faultstring;
echo $errors;
}
$s_object = new SObject();
$s_object->fields = $create_fields;
$s_object->type = 'Lead';
$s_object->fieldsToNull = array("Company");
// the "null" is the assignmentRuleID arguement and the "true" is useDefaultRule arguement
$header = new AssignmentRuleHeader(null, true);
$leadResult = $mySforceConnection->create(array($slead_object),$header, NULL);