I am creating a workflow, which sends an email to the user before 10 business days (only excluding Saturday and Sunday). For example If the product delivery date is 11/28/2013, It will send an email on 11/14/2013. Can any of us help me with this ? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Sachin KumarSachin Kumar 

I am creating a workflow, which sends an email to the user before 10 business days (only excluding Saturday and Sunday). For example If the product delivery date is 11/28/2013, It will send an email on 11/14/2013. Can any of us help me with this ?

I am creating a workflow, which sends an email to the user before 10 business days of product delivery date(only excluding Saturday and Sunday). For example If the product delivery date is 11/28/2013, It will send an email on 11/14/2013. Can any of us help me with this ? Thanks in advance.
Anshul JainAnshul Jain
Hi Sachin,

Currently within standard functionality time-based workflow actions are based on over all days and cannot exclude weekends.

So in order to execute the Workflow Email alert based on business days; here is what needs to done.

1) Create a Formula field to calculate the number of working days / business days.
https://help.salesforce.com/HTViewSolution?id=000004526&language=en_US
https://success.salesforce.com/answers?id=90630000000gweUAAQ
http://boards.developerforce.com/t5/Formulas-Validation-Rules/Formula-for-tracking-ONLY-Business-Days/td-p/37478

2) Create a workflow which would trigger once the value in the field created above is =10.


Hope this helps.


Regards,
Anshul

Subramanyam MeareSubramanyam Meare
Hey Sachin,

As you only want the Email alert to be triggered 10 days after Product delivery date excluding weekends,You could follow below steps to achieve:-

Step 1:- Create New Custom Formula field

Data type:- Formula

Formula return type:- Date

Formula :-

Appointment_date_time__c +10+
CASE(MOD(Product Delivery Date-DATE(1900,1,7),7),
0,2,
1,4,
2,4,
3,4,
4,4,
5,4,
6,3,0)

Step 2:- Create the Workflow rule in below manner:-


Evaluation criteria:- Every time record is created & Subsequently meet criteria

Rule criteria:- Formula evaluates to true

Formula:-  NOT(ISBLANK(CreatedDate))

Save it & define Time trigger as :-

0 days before Custom formula Date field & then define Email alert for it.


To test whether your Workflow is scheduling the Email alert exactly after 10 days (excluding Weekends),You could  navigate to Go---Setup---Administration setup---Monitoring---Time based Workflow --Enter your workflow name---check the schedule Date.

Regards,
Subbu.