How to set due date in Ask for approval action in flow designer

mickydash2001
Tera Contributor

Can anyone suggest how to set due date for ask for approval in flow designer without auto-approve auto-reject or auto-cancel? I tried with adding calculate catalog task due date action but getting one error

 

 

 

class com.glide.glideobject.GlideDateTime cannot be cast to class java.lang.String (com.glide.glideobject.GlideDateTime is in unnamed module of loader com.snc.orbit.container.tomcat8.Tomcat8$OrbitTomcat8ClassLoader @ae40e9; java.lang.String is in module java.base of loader 'bootstrap')

 

 
8 REPLIES 8

Sandeep Rajput
Tera Patron
Tera Patron

@mickydash2001 Will it be possible for you to share the snapshot of your flow here?

@Sandeep Rajput 

This is the script I wrote 

var gdt = new GlideDateTime();

gdt.addDaysUTC(2);

return gdt;

I tried with this too

var gdt = new GlideDateTime();
var time=gdt.toString();
time=time.split(' ');

gdt.addDaysUTC(2);
var gdt1=new GlideDateTime(gdt.getDate()+' '+time[1]);
return gdt1;

 

I am not sure about the context of this script however if you would like to get the date value in string then do it as follows.

 

var gdt = new GlideDateTime();

gdt.addDaysUTC(2);

return gdt.getDisplayValue();

I tried with this not getting any error here but the due date field is showing empty 

c.jpeg

So the context is I want to set the due date to 2 days from the current date but after 2 days also the approval should show requested it shouldn't auto approve or auto reject. Here is my flow and the error

a (2).jpeg

b.jpeg