can I use the SetTimeout() function within a business rule, or something equivalent?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2011 12:44 PM
Does the SetTimeout() function work in a business rule as it does in a client script? I know there are things that will/will not work between the two. Basically I need to add a delay within a business rule before I manipulate a field.
Thanks for the help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2011 12:47 PM
setTimeout is client side javascript. You should be able to use 'gs.sleep()' though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2015 07:20 PM
Mark Stanger, I also had a need for this in a custom application that we are building out.
I had a question about it though, that may seems like a crazy question, but I have to make sure.
doing
gs.sleep(5000);
only pauses the execution for the executing code, and NOT other code that is being executed, correct?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2015 06:10 AM
That depends on whether the other code is executing synchronously or not. Any code after the 'gs.sleep' command will wait for the full sleep to happen first unless it's in an async business rule I believe. Outside of that, it would be the 'order' field on a business rule for example that would control the synchronous ordering.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2017 05:48 AM
Hi Mark,
Maybe out of context, but we want to pause the notification script execution for some time. Do you think using gs.sleep() is a good idea in there?
Please let me know.
Thanks