Named Query Path not found in Inherited/Parent Project, when it only exists in Calling/Child Project

Hello all,

I am getting an exception (sometimes, but not every time) when trying to call a Named Query. The python script exists on the root container of a Perspective View, in order to refresh the screen after certain events.

This environment has an inheritance structure of [ProjectC and other Children] > ProjectB > ProjectA. There are at least 30 child projects all inheriting from this chain. Also, the “Gateway Scripting Project” is set to ProjectB.

My issue, is that the Named Query I am trying to execute ONLY exists in ProjectC, but the exception occurs from searching ProjectB. And again, sometimes the script is successful. One other thing to note is that the Named Query is in its own “local” folder, and there are numerous other “inherited” folders. At this time, only one of the inherited folders is overridden, but that path is not involved in this screen refresh script.

Python Exception:
Traceback: File "", line 16, in screenRefresh
java.lang.Exception: Query path ‘localfolder/namedquery1' not found in project 'ProjectB'.

Offending Script:
[Line15] sPathNamedQuery = ‘localfolder/namedquery1’
[Line16] oResult = system.db.runNamedQuery(sPathNamedQuery, {})

By the way, this is a SELECT query, with a sub-select-query in the WHERE clause

Sounds like a tag event (or other purely gateway scope caller) is trying to use that function. If one of the other heirs of ProjectB used it, it would show that project's name.

Search your tags for callers of that function. Then search ProjectB for any indirect callers of that function, and then search your tags for those, too.

Hmm, a good thought, but I did not make any gateway scripts or tags for this segment of the project. I still checked with the Ctrl-F search in Designer for all Tag Providers and all Scripting, and that turned up 0 results.
So it only exists on my single View (verified again with Ctrl-F).

I think I have found a work around for this issue.
I pass in the "project" parameter for the "system.db.runNamedQuery()" to force the scope of the Named Query.
However, I am still not sure what was happening or why it wasn't every time.