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
RathishRathish 

How to activate lead assignment rule through code.

Hi,
I have a serious issue. How to activate the lead assignment rule thorugh code. I am working on c#. I tried using AssignmentRuleHeader. But it didnt work for me.
 
Please help.
 
Thanks and Regards,
Rathish.
SFDCCoderSFDCCoder

Put this in your login function:

 

'sometimes we want to deactivate rules for testing

If AppSettings("ActivateRules") Then

'***important to set the binding to use rules

Dim assignrule As New AssignmentRuleHeader

assignrule.useDefaultRule = True

binding.AssignmentRuleHeaderValue = assignrule

'end setting bindings to use current rules

End If