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

Jason Stephens
Kilo Guru

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.

7 REPLIES 7

Mark Stanger
Giga Sage

setTimeout is client side javascript. You should be able to use 'gs.sleep()' though.


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?


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.


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