How to schedule a workflow to prevent executing on Sunday via Schedule Job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2024 09:53 PM
Hi Everyone,
How to schedule a workflow to prevent executing on Sunday via Schedule Job.
Thanks,
Chhavi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2024 10:08 PM
Can you provide the details of your workflow? What is the trigger condition, which table?
Are you using a workflow or flow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2024 10:57 PM
HI @sachinbhasin11 ,
I have created a new field 'Is Critical' on Incident table, once this field is checked (mark as TRUE) then workflow will start and change the Priority to Critical and Trigger Approval to User 'System Administrator':
Please guide me, how I can put condition n Scheduled Job and Run the script accordingly.
Thanks!
Chhavi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2024 04:32 PM
Hi Chhavi,
Thanks for sharing, I think Ravi has provided the guidance on how to trigger the workflow on a specific day of the week.
However, I feel you can use the same business rule to set your values as well and don't call a separate workflow to do the same. This way all your processing logic remains in one single object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2024 10:13 PM
Hello @Chhavi Dixit
assuming you have the script ready to call workflow from Scheduled Job, please find below conditional script to exclude Sunday
// 0=Sunday,
// Get today's date
var today = new Date();
dayOfWeek = today. getDay();
if (dayOfWeek > 0 && dayOfWeek < 7){ //it will iterate from Monday to Saturday
answer = true;
}
else {
answer = false;
}
refer:
You can also refer
Please mark the answer as helpful and correct if helped.
Kind Regards,
Ravi