function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krhkrh 

Hi, I need to prevent task due date fall over weekend.

We are using time dependent workflow action to generate a task and due date is StartDate__c+ 21 days ,Any tasks due on a Saturday should automatically default to the Friday prior to it and any tasks due on a Sunday should automatically default to the following Monday.

Please help me to  achieve this

Thanks in advance
Best Answer chosen by krh
Sai_KSai_K
Hi Hema,

You can use WEEKDAY function for this scenario in formula field.

IF((WEEKDAY(DATEVALUE(StartDate__c + 21))= 7), StartDate__c + 20, IF((WEEKDAY(DATEVALUE(StartDate__c + 21) )= 1), StartDate__c + 22, StartDate__c + 21))