0

Is it possible to run the script in a button from another script?

There are five buttons in a form. 

Each compiles a portion of a report. 

I would like to have a sixth button with a  "generate full report" script that activates the script in each of the other five buttons. 

8 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    Sadly you can’t activate buttons from a script. Unless this is a hidden feature thatJacques TUR hasn’t found yet. 😉

    You will have to copy and paste the code from the other 5 buttons into the 6th one  

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    I think the best solution is to create a global function for each button. The 6th button calls all functions directly.

    If you use the running record in your buttons, you can pass it as a parameter like this:

    function myGlobalFunction1( rec : myTableName ) do
        rec.myFieldName := ....
    end;

    On the button formula, you call function like this :

    myGlobalFunction1( this );
    • NYNNA
    • Louis_Cornacchia
    • 1 yr ago
    • Reported - view

    so what language is this? "function myGlobalFunction1( rec : myTableName ) do rec.myFieldName := .... end;"

    • NYNNA
    • Louis_Cornacchia
    • 1 yr ago
    • Reported - view

    Thank you. yes, know that.  Do you now if it is derived from another language? 
     

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Louis Cornacchia It's a language specific to Ninox. 

      I would say that it looks a bit like Pascale and JavaScript:
      It is pre-compiled (like Pascale and unlike JavaScript) but some parts can be compiled at runtime, such as the close where of the select statement and the code passed as parameter of the eval function. 

      It is typed, that is to say that the types of variables parameters and functions must be defined (like Pascale and TypeScript and contrary to JavaScript 

      It can be synchronous or asynchronous (like JavaScrip and contrary to Pascale), that is to say that a part of the program continues to execute while another is not finished, as for example with do as server which launches the execution on the server while the end of the procedure continues to be required locally.
       

    • Mel_Charles
    • 1 yr ago
    • Reported - view

    It is bespoke to Ninox but I think it is a sub set of Javascript or closely based on that.

    • NYNNA
    • Louis_Cornacchia
    • 1 yr ago
    • Reported - view

    Thank you both. Very interesting. 

Content aside

  • 1 yr agoLast active
  • 8Replies
  • 191Views
  • 3 Following