You need to sign in to do that
Don't have an account?
rmranjith8881.3927046400771116E12
How to exclude Weekends on Workflow Task Due Date?
Hello Everyone,
How to exclude Weekends on Workflow Task Due Dates?
On Workflow Tasks, we are setting up a due date extending with 'X' days, here, we need to exclude the weekends.
For Example, if we setup a workflow task to "Rule Triggered Date + 5 Days" and if that 5th day falls on weekend either Saturday or Sunday, SF should automatically consider the next Business Day, i.e Monday.
Different Workflows have different Due Dates, need to work it for all Workflow Tasks (on different Objects), irrespective of Due Date.
And Different Workflows have multiple actions like Email Alert, Field Update and Outbound Messages along with Tasks.
Can any one please help me out on achieving same?
Thanks in Advance,
Ranjith.
How to exclude Weekends on Workflow Task Due Dates?
On Workflow Tasks, we are setting up a due date extending with 'X' days, here, we need to exclude the weekends.
For Example, if we setup a workflow task to "Rule Triggered Date + 5 Days" and if that 5th day falls on weekend either Saturday or Sunday, SF should automatically consider the next Business Day, i.e Monday.
Different Workflows have different Due Dates, need to work it for all Workflow Tasks (on different Objects), irrespective of Due Date.
And Different Workflows have multiple actions like Email Alert, Field Update and Outbound Messages along with Tasks.
Can any one please help me out on achieving same?
Thanks in Advance,
Ranjith.
We don't have any option as such in our standard recurrence functionality for Task to exclude weekends on the selection of option "daily" but we can change them at the time creation using a trigger.
Please find the sample code below and tweak it as per your requirement. Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
Thanks for your reply,
The above code will work for all Tasks perfectly, but, I want to exclude weekends for Workflow (auto) Tasks only, we can give the users to put their own Tasks to Weekends manually, if they want.
How do we achieve this?
Thanks,
Ranjith.
In your above logic, you have used date datype. could you please provide your answer if we are having datetime datatype.
for example, I am having a datetime field called (Submit_deal_datetime__c). When user selects a date (Lets say, weekend date (06/12/2021) or (06/13/2021) which falls under saturday and sunday respectively), then in another field called (submit deal_report__c) should populate firday'date( 06/11/2021). Please let me know if you are clear. Else will connect and solve this. Thanks.