Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

...

void myScript.ThrowIfCancelled()

...

This method is useful when you want to check the current transaction is cancelled canceled and abort the current operation.

...

Code Block
languagejs
function longRunningMethod() {
 

  var isCompleted = false;

    while(!isCompleted) {

      isCompleted = SomethingRunningLongTime();

        // break if cancelled
    Script.ThrowIfCancelled();

   
  }

}