+ Start a Discussion

How to activate lead assignment rule through code.

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,

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