This project script calls a named query. Typically, it's from the gateway scope, so my named query call has extra parameters when calling from the button press (project/client) scope that is causing errors.
Any way to avoid this without adding an extra parameter to my project script?
I decided to just add an optional parameter to my project script, since that's the easiest solution. Default "clientScope" variable to 0 (false), and it can be provided as true when needed to call from the project scope.
You can also use system.util.sendMessage to the gateway and let the gateway message handler call the library script. It will then be in gateway scope all of the time.