runNamedQuery on tag Change event not finding Namedquery


Was wondering if anyone is having this problem with running system.db.runNamedQuery() on a tag change event.

From the manual I understand that we need to add additional projectName when calling the function. However, when I try to do this on a tag change event it cannot find NamedQuery

Boolean Tag
On Tag value change event:

if not initialChange:
projectName = ‘DVI’

When I toggle the tag I get error on event saying it cannot find the named query.

  • If i remove the projectName it errors out saying it cannot find project. So I know for sure this is being executed on gateway scope.

Any thoughts on why it is not finding the named query? is this bug or am I missing something?



Answered my own issue:

I needed to publish after even if I have saved changes in designer

Normally when I created a named query I can access it immediately without publishing. Did not realize it behaves differently when trying to run in global scope.

When running the runNameQuery in global scope you need to publish any new named queries you created for it to be recognized properly.