+ Start a Discussion
GoForceGoGoForceGo 

Visual Force E-mail Template/Workflow Order of Execution

I have workflow rule that fires, updates some due dates (e.g today + 30 days) and send out an e-mail alert that includes the due date. The workflow rule documentation say that field updates are evaluated before other actions (http://login.salesforce.com/help/doc/en/workflow_rules_considerations.htm)

 

1. When I use a visualforce e-mail template, the due dates are NOT populated in the e-mail send out. When I test the VF template using  "Send Test and Verify Merge Fields", it works perfect - so my merge field syntax for the due dates is okay. 

2. When I use a non-VF e-mail template, the due date merge field is populated correctly.

3. I worked around the issue by having two workflow rules - the first one that sets the due dates and checked "Re-evaluate Workflow Rules after Field Change". The second workflow rule fires when due date is set and hence fires in sequence.  

 

So, is something going on with order of execution when VF templates are used?