Set Global variable Is Not working in Run Mode

Support
  • 
      /////Start script after run button is clicked
      $("#RunScript").on("click", function () {
        /////Validate resources
        if (IsResourcesValid()) {
          /////Disable run button immediately
          $("#RunScript").attr("disabled", "disabled");
          /////Start script
          Api.AcceptResources();
        } else {
          /////Ask user if he want to continue
          UIkit.modal
            .confirm(
              tr(
                "There are incorrectly filled fields on the form. Are you sure, that you want to continue?"
              )
            )
            .then(function () {
              $("#RunScript").attr("disabled", "disabled");
              Api.AcceptResources();
            });
        }
    
        console.log("starting");
        Api.SetGlobalVariable("TEST", "This is a Test").then((x) => {
          console.log("seted");
        });
        Api.GetGlobalVariable("TEST").then(function (GlobalVariableValue) {
          console.log("GlobalVariableValue", GlobalVariableValue);
        });
      });
    

    it's working Only In Record Mode Not Working when i Run It.

  • 0 Votes
    2 Posts
    818 Views
  • Setting Fail output

    Support
    0 Votes
    2 Posts
    594 Views
  • Spotify works with

    Support
    1 Votes
    5 Posts
    2002 Views
  • Variable in request

    Moved Support
    0 Votes
    1 Posts
    555 Views
  • How to Array variable.

    Support
    0 Votes
    5 Posts
    993 Views