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
PauloPaulo 

Assignment Rule not working

Hi,

I am having problems with the autoassignment rules working when I submit a lead using the api 4.0 into salesforce. The lead owner is always set to the user that I use to log into salesforce. How can I get my app to use the autoassign rules I have set up in salesforce? I am using the 4.0 api, asp.net and c# to develop my app.

SuperfellSuperfell
You have to include an AssignmentRulesHeader in the request that controls which rules are run, see AssignmentRulesHeader in the docs.
PauloPaulo
The doc only shows a java example. Any idea where I can find a c# sample?
SuperfellSuperfell
Works the same as the SessionHeader, something like

svc.AssignmentRuleHeader = new sforce.AssignmentRuleHeader();
svc.AssignmentRuleHeader.useDefaultRule = true;
svc.AssignmentRuleHeader.useDefaultRuleSpecified = true;
PauloPaulo
I got it to work. thanks Simon for all of your help once again.