function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael McGarrityMichael McGarrity 

Setting AssignmentRuleHeader in PHP toolkit

Hi,

I'm using the SalesForce PHP Toolkit to push leads into our SalesForce instance. It works great pushing the leads in however I want to enable Sforce-Auto-Assign to be TRUE.

Where do I do include this in my code?


 
AnudeepAnudeep (Salesforce Developers) 
Hi Michael - As per the documentation, If the header is not provided in the request, the default value is TRUE

Nevertheless, If it were in REST API, it would look something like this
 
HttpPost httppost = new HttpPost(environmentId + "/services/data/v33.0/sobjects/Case/"+ caseId);
httppost.setHeader("Sforce-Auto-Assign", TRUE);

I am unsure how the setHeader function is used in PHP. I am guessing it looks like this
protected function _create($arg) {
        $this->setHeaders("Sforce-Auto-Assign", TRUE);
       return $this->sforce->create($arg)->result;
        }

If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!

Anudeep