Lead Workflow Escalation Rule

I am trying to automatically change the stage of a lead based off the last time the lead was communicated with. I have tested this WHERE clause in SQL directly and it works, but for some reason it wont fire in CRM. Any ideas?

Lead_Status='In Progress'
AND Lead_Stage NOT IN('3Day','7Day','14Day')
AND Lead_CreatedDate > '2017-10-20'
AND DATEDIFF(day, Lead_CreatedDate, GETDATE()) >=3
AND (DATEDIFF(day, Lead_CreatedDate, lead_LastCommDate) >=3 OR lead_LastCommDate IS NULL)
AND Lead_Deleted IS NULL

  • 0

    Hello

    I can see how the SQL works in MS SQL directly. But have you looked at the logs? Make sure that you have all SQL being written to the logs.

    You need to check to see if the rule is being found and understood as an enabled rule. Then you should see the whether the rule fires or not and what is the actual SQL sent to the database.

  • 0

    I am assuming it is not running correctly. I see in the log "RunEscalations,EWAREDLL,3 Day Follow-up,DontDoRule,select * from vWorkflowActions where WkRl_RuleId = 10165 AND Wkac_action = N'Notify'"

    Any idea why this would be? I have the rule enabled as you can see from the first post.