7 Replies · Latest reply on Dec 28, 2017 5:48 AM by Vidyasagar Patro

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

      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.

        • setTimeout is client side
          Mark Stanger

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

          2 of 2 people found this helpful
          • Parameter is in
            Capa JC

            Parameter is in milliseconds. So gs.sleep(5000); will give you a 5-second pause.

            • I'm just curious - do you

              I'm just curious - do you know why it is that you need to pause?

                • We have a business rule
                  Jason Stephens

                  We have a business rule that, when it finishes/updates, triggers an outbound update to Omnibus. In that business rule, we are appending an "-x" to the correlation ID field in the incident to signify closed to Omnibus. Basically the "-X" causes the correlation ID to NOT match any inbound ID's from Omnibus, so we know to create a new incident.

                  We need the pause before the field update to allow the outbound message to be sent to Omnibus before the "-X" is added. If the "-X" is added before the update, then Omnibus is confused because the correlation ID doesn't match any that it has out there.

                  This is a very roundabout way to id, but due to the implementation of Omnibus in our environment, this is the way we are trying to do it.

                  I'm open to suggestions - I actually have another post asking if anyone can help me remove the "-X" in the outbound message before it send to Omnibus. I don't know enough about this piece of code to make that happen, so the only other way I could fiuyre to do it was to delay the field update until the message got sent.