Schedule state in Normal Change.

sireesha19
Tera Contributor

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.

 

1 ACCEPTED SOLUTION

Ramesh_Naidu
Mega Guru

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.

View solution in original post

2 REPLIES 2

Ramesh_Naidu
Mega Guru

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.

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.