How to Delay Business Rule for some time

swaroop
Kilo Sage

Hello All,

A Business Rule is there which will trigger based on a condition. But the script in the Business Rule should trigger after some delay of 1minute. When i am using gs.sleep() it is not working.

Can anyone suggest me how to delay the script to run for 1min after theBR triggers based on the condition.

 

 

Thanks & Regards,

S.Swaroop.

12 REPLIES 12

@swaroop 

Hope you are doing good.

Did my reply answer your question?

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

Also why are you using current.update() in BR; it is not good practice.

Instead make this BR as before update

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

vkachineni
Kilo Sage
Kilo Sage

You can create an event scheduled after a certain amount of time

 

Here is a code snippet

var gdt = new GlideDateTime(gr.sys_created_on);

gdt.addDaysUTC(1);

gs.eventQueueScheduled('approval.reminder', gr, '', '', gdt);

You can then write a script to handle the event when it gets processed.

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022