You need to sign in to do that
Don't have an account?
Web Development
Set Headers PHP Toolkit
I made a fix on the SforceBaseClient.php to allow for multiple headers.
Here is the Patch :
50a51
> protected $assignmentRuleHeaders;
240a242,248
>
> $headers = $this->assignmentRuleHeaders;
>
> if ($headers != NULL) {
> $header_array = array_merge($header_array, $headers);
> }
>
340a349,371
> public function addAssignmentRuleHeader($header) {
> if ($header != NULL) {
>
> if (!isset($this->assignmentRuleHeaders)) {
> $this->assignmentRuleHeaders = array();
> }
>
> $header_values = array();
>
> if (isset($header->assignmentRuleId)) {
> $header_values['assignmentRuleId'] = $header->assignmentRuleId;
> }
>
> if (isset($header->useDefaultRuleFlag)) {
> $header_values['useDefaultRule'] = $header->useDefaultRuleFlag;
> }
>
> $this->assignmentRuleHeaders[] = new SoapHeader($this->namespace, 'AssignmentRuleHeader', $header_values);
> } else {
> $this->assignmentRuleHeaders = NULL;
> }
> }
>
Then you can use something like the following :
foreach($rules as $rule) {
$ruleHeader = new stdClass();
$ruleHeader->assignmentRuleId = $rule->id;
$this->connection->addAssignmentRuleHeader($ruleHeader);
}
This is good for when you are dinamically reading WebForms
@ Luis A. Camilo [https://www.linkedin.com/pub/luis-camilo/13/b6b/688]
Here is the Patch :
50a51
> protected $assignmentRuleHeaders;
240a242,248
>
> $headers = $this->assignmentRuleHeaders;
>
> if ($headers != NULL) {
> $header_array = array_merge($header_array, $headers);
> }
>
340a349,371
> public function addAssignmentRuleHeader($header) {
> if ($header != NULL) {
>
> if (!isset($this->assignmentRuleHeaders)) {
> $this->assignmentRuleHeaders = array();
> }
>
> $header_values = array();
>
> if (isset($header->assignmentRuleId)) {
> $header_values['assignmentRuleId'] = $header->assignmentRuleId;
> }
>
> if (isset($header->useDefaultRuleFlag)) {
> $header_values['useDefaultRule'] = $header->useDefaultRuleFlag;
> }
>
> $this->assignmentRuleHeaders[] = new SoapHeader($this->namespace, 'AssignmentRuleHeader', $header_values);
> } else {
> $this->assignmentRuleHeaders = NULL;
> }
> }
>
Then you can use something like the following :
foreach($rules as $rule) {
$ruleHeader = new stdClass();
$ruleHeader->assignmentRuleId = $rule->id;
$this->connection->addAssignmentRuleHeader($ruleHeader);
}
This is good for when you are dinamically reading WebForms
@ Luis A. Camilo [https://www.linkedin.com/pub/luis-camilo/13/b6b/688]
Thank you for sharing this information on community boards. This would be helpful for everyone.