What is the best way to run a named query from a button click event and pass in parameters?
You could create a script action on the button click event. In the script, you could invoke system.db.runNamedQuery(…)
See: https://docs.inductiveautomation.com/display/DOC80/system.db.runNamedQuery