Issue in updating Due date on RITM & Request

dhanashree2011
Tera Contributor

I have requirement where i have the requirement to set due date on RITM & Requests. I tried to achieve it using Business Rule ( Before, Insert) and used below code. But somehow it is not working.

var gd = new GlideDate();
gd.addDays(4);
current.u_estimated_time_of_delivery = gd;

var gdt = new GlideDateTime();
gdt.addDays(4);
current.due_date = gdt;

 

Any suggestions?

1 ACCEPTED SOLUTION

Bjarne Nielsen
Tera Expert

It would not be good practice to have a Business Rule set the Due Date, since it should be dynamic and related to the specific Catalog Item.

Instead I would recommend you use a flow to set this value. You can use Transform Functions to do the calculation without scripting:

BjarneNielsen_0-1707927903146.png

 

View solution in original post

3 REPLIES 3

kps sumanth
Mega Guru

Hello @dhanashree2011 ,

 

Can you update 6th as below and try.

current.setValue('due_date', gdt);

My Apologies.. But it doesn't seem to work

Bjarne Nielsen
Tera Expert

It would not be good practice to have a Business Rule set the Due Date, since it should be dynamic and related to the specific Catalog Item.

Instead I would recommend you use a flow to set this value. You can use Transform Functions to do the calculation without scripting:

BjarneNielsen_0-1707927903146.png