+ 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