Calling ‘runScriptNamed()’ with Parameters

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Script Talk Calling ‘runScriptNamed()’ with Parameters

Viewing 2 reply threads
  • Author
    Posts
  • August 28, 2021 at 9:33 AM #45118

    Konrad Schoettl
    Participant

    I have defined a form script that is called via ‘runScriptNamed()’ twice from different field scripts. This is basically working. An example: I have a form for all persons (authors, translators, actors, …). Within this form, I have fields for the date of birth and death. As sometimes only the year is known, in both cases I have defined separate fields for day / month / year. As for the month, there is a picklist with options ‘january, february, …). Now there is a script field which stores the person‘s name along with the dates of birth and death, for example ‘Wells, H. G. (21.09.1866 – 13.08.1946)’. To get this, a form script converts the month (september) to a numeric like text (09). This is done for birth and death.
    Now the problem: It seems there is no way to call the form script (‘runScriptNamed’) with parameters?
    I found a solution by using global variables, which works, but perhaps there is another (perhaps better) solution?

    Thanks for any ideas or hints!
    Konrad

    August 28, 2021 at 11:40 AM #45119

    Daniel Leu
    Participant

    The script you are calling should just define a function or several functions. So you don’t call the function at the end of the script that you usually would in a form or field script. Once the runScriptNamed() was executed, you would call the function in question with the given parameters.

    August 28, 2021 at 12:05 PM #45123

    Daniel Leu
    Participant

    Another option is to use a tapformz url:

    Utils.openUrl('tapformz://script/db-xxxx/frm-xxxx/ScriptName?option1=A&option2=B')

    This way you can directly call the script with the given parameters.

Viewing 2 reply threads

You must be logged in to reply to this topic.