btw using a $$Global it works nicely as follows:
1) Pause the Popover Button Script
2) Sub-button runs a script that sets a $$Global if a "401" occurs.
3) Set sub-button script "OPTION" to resume script.
4) Popover Button Script resumes
5) Use $$Global variable and if($Global = "triggered state") to run "Custom Dialog"
6) Reset $$Global to "un-triggered state"
If it ain't broke why try to fix it?
Unless one script is performed as a subscript of the other using the perform script step, a field or global variable are your only options for one script to pass data to the other.
Not sure why the sub button's script doesn't display the custom dialog.
If you use subscripts you can end each script with an on exit script parameter which can be captured by the parent script and bypass globals and variables.
perform script x
exit script ( insert a value )
set variable $XXXX to get(scriptresult) --.> the matching exit script / get(scriptresult)
Local variables are restricted to the script so you can build numerous variables from various perform scripts.
if $X = xxxx
else if $x = yyy
I was just trying to keep my code DRY.
setting and re-setting a $$global seemed the most straight forward.
Many ways to do this bit like Phil said 'If it ain't broke why try to fix it?
Yes but note my other comment:
Why do this at all?
Script one, performed by opening the popover, just sets up values, focus etc. and exits. Script two, performed by clicking a popover button, performs the find and also displays any needed messages to the user.
This works especially well if you are using global fields inside the popover panel for entering search criteria.