runNamedQuery()

One more aspect to be aware of/may save you some time in the future. This got me good for a while on fully understanding the different scopes.

I was using the runNamedQuery() in the alarm pipeline and I forgot that is a Gateway scope module. So the name of my project needed to be added. Took me way longer to figure out than it should have.

example:
Script console (designer scope? only works in designer):

db = system.db.runNamedQuery("Your Saved Name Query", {"pram1":"value",etc})

vs the alarm pipeline (Gateway scope)

db = system.db.runNamedQuery("ProjectName", "Your Saved Name Query", {"pram1":"value",etc})

If needed this post is really good at knowing what scope a script is coming from