- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-28-2024 02:17 AM
Many a times there is a need to add some delay in your script in server side.
Below script will work in both global + scoped app. The value passed is duration value. I passed 10 seconds in duration format. It can be customized as per your requirement.
Script:
gs.info('Before delay->' + new GlideDateTime().getValue());
var now = new GlideDateTime();
while(GlideDateTime.subtract(now, new GlideDateTime()) < "1970-01-01 00:00:10") {
// loop for 10 seconds}
gs.info('After delay->' + new GlideDateTime().getValue());
Output: Global scope
Output: Scoped app
- 2,049 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Ankur Bawiskar ,
I tried this in my script but it didn't work. I want the workflow to trigger after few seconds. Can you please let me know what am i doing wrong here?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
can you post this as a separate question, share all the details and tag me there
