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
    527 Views
  • 0 Votes
    8 Posts
    1325 Views
  • how to fix failed to run database

    Support
    0 Votes
    5 Posts
    1207 Views
  • 0 Votes
    3 Posts
    1001 Views
  • 1 Votes
    2 Posts
    1878 Views