Adding timer in Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 02:05 AM
Hello behind the notification I need to put a timer before triggering the notification in Business rule.
What code can I use/add?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 02:20 AM - edited 06-08-2023 02:24 AM
Dear @Uchel ,
using gs.sleep('5000');
This will hold the execution of code in milliseconds based on the value that you pass... but this can have an impact of slowness kindly evaluate the risk and proceed. Also, Instead of using gs.sleep() use events for triggering that BR, it's best practice. Here's an example of delay applied on business rule and trigger event:
var when = new GlideDateTime();
var delay = new GlideTime();
delay.setValue("00:00:05");
when.add(delay);
gs.eventQueueScheduled("event_name", current, "", "", when);
Why don't you use flow designer + events to achieve this instead of using business rule..
I hope it helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 07:10 PM
But Is it possible to add timer in Business rule before can trigger the email?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2023 02:40 AM
Hi @Sohail Khilji ,
I tried the code gs.sleep('120000'); in BR but why the email cannot trigger? I'm just waiting 2 mins but no email send.
This is the BR that no gs.sleep code:
And this is the email trigger:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 05:51 AM
Hello I tried that but it's happen again the Intermittent issue.
Do you have idea how to create Flow designer for this issue?
Here's the Email script and BR:
SLA:
Thank you.