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

**URL:** <https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724>\
**Category:** Ignition\
**Tags:** ignition81, perspective, namedqueries\
**Created:** [May 15, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724 "2023-05-15T13:55:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominicfabiilli](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dominicfabiilli](https://forum.inductiveautomation.com/u/dominicfabiilli)\
**Post date:** [May 15, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724/1 "2023-05-15T13:55:25Z")

</div>

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, {})

---

<div class="post-metadata">

**Author:** ![dominicfabiilli](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dominicfabiilli](https://forum.inductiveautomation.com/u/dominicfabiilli)\
**Post date:** [May 15, 2023, 1:59pm UTC](https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724/2 "2023-05-15T13:59:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 15, 2023, 2:01pm UTC](https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724/3 "2023-05-15T14:01:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dominicfabiilli](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dominicfabiilli](https://forum.inductiveautomation.com/u/dominicfabiilli)\
**Post date:** [May 15, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724/4 "2023-05-15T14:29:42Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![dominicfabiilli](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dominicfabiilli](https://forum.inductiveautomation.com/u/dominicfabiilli)\
**Post date:** [June 1, 2023, 1:25pm UTC](https://forum.inductiveautomation.com/t/named-query-path-not-found-in-inherited-parent-project-when-it-only-exists-in-calling-child-project/73724/5 "2023-06-01T13:25:50Z")

</div>

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.
