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
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.
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.