- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 06:32 AM
Hello community,
I need to add a new state in change form called schedule for this i am trying to add a new state in change workflow.
Now the requirement is we have field called start date(Glide datetime) now when the workflow is triggered it will be in some states until it gets approved after approval the workflow should wait until date & time reaches as there in start date field after reaching this it should go to next stages. I have created a wait for condition which will check for start date and time == 0 is not at all working.
so can anybody help me with wait for condition with script.
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 12:29 PM
Hi @sireesha19,
In the Wait for condition, you can use this script
var gd = new GlideDateTime(); // current system time
var gd_start = new GlideDateTime(start_date); // setting the start date value
if (gd == gd_start) // comparing
{
answer = true;
}
else{
answer=false;
}
Thankyou.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 12:29 PM
Hi @sireesha19,
In the Wait for condition, you can use this script
var gd = new GlideDateTime(); // current system time
var gd_start = new GlideDateTime(start_date); // setting the start date value
if (gd == gd_start) // comparing
{
answer = true;
}
else{
answer=false;
}
Thankyou.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 08:06 AM
Hi @Ramesh_Naidu , Thankyou for reply i have used timer condition in the workflow to wait until the start date time so, it is worked as expected. the script provided by you is correct it will also work.
Thankyou.