You need to sign in to do that
Don't have an account?
Guru Vemuru 1
How to send email alert only on week day not in weekends?
Hi all,
I have a requirement to sent email alert to lead owner and conditions are like
I have a requirement to sent email alert to lead owner and conditions are like
- Alert will go to lead owner after 2 hours from lead created time
- Lead owner will get mail only Week days and not in week ends
How can i find out day is Sat and Sun.
Leads which are coming on sat ansd sun. we have to send mail alert on Monday morning 11am.
how to do it
I found the created day is it sun, mon..... and according to that by giving condition I can able send mail.
Now the problem is the leads which are created in sun and sat. I have to notify on Monday morning 11 AM.
How can I do it
I modified a formula that i found on the iner net and have used before but I have tested for your case.
Try
CASE(
MOD( date - DATE( 1900, 1, 7 ), 7 ),
6, (Created Date) + 59/24 days),
7, (Created Date) + 35/24 days),
(TimeValue(Created Date) =2 Hrs)
)
The formula finds the day of the week of the date field value. If the date is 6, Saturday you add 2 days and 11 hours, if it is 7, Sunday add an extra day and 11 hours, you may need to take account of your time zone relative to GMT and adjust the hours accordingly.
Created a new field 'Weekday with Time' and used the formula below:
CASE(
MOD( DATEVALUE(CreatedDate)- DATE( 1900, 1, 7 ), 7 ),
0, ((CreatedDate) + 1),
6, ((CreatedDate) + 2),
CreatedDate
)
Here 0 is Sunday and 6 is Saturday. So we are basically adding 1 day when its Sunday and 2 days when it is Saturday. So suppose your lead gets created on 9/3/2023 9:46AM (Sunday), the Weekday with Time will be the same time Monday 9/4/2023 9:46AM.
Also if you want to send it in the business hours, this package (https://unofficialsf.com/flow-datetime-methods/) (https://unofficialsf.com/flow-datetime-methods/) can be installed. You can use an Action element to call the Apex method and pass in a date/time method to compare against business hours.