system.db.runNamedQuery() problem on client

I’m using this function on Designer and it works. When I save the project and start the client it won’t work.
image

What does not working mean? It’s returning the wrong results, or no results? Or is it throwing an error? If it’s throwing an error, what’s the full details of the error? What version of Ignition is this?

1 Like

This is the error:

Traceback (most recent call last):

File “event:actionPerformed”, line 10, in

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Named query LoroPiana/getLottiList not found

caused by GatewayException: Named query Folder/getLottiList not found
caused by GatewayFunctionException: Named query LoroPiana/getLottiList not found

Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_251

Does your project have manual publishing enabled? Maybe you’ve saved the named query, but not published it? That would let it work in the designer, but not clients.

Traceback (most recent call last):

File “event:actionPerformed”, line 10, in

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Named query LoroPiana/getLottiList not found

caused by GatewayException: Named query LoroPiana/getLottiList not found
caused by GatewayFunctionException: Named query LoroPiana/getLottiList not found

Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_251

I’ve imported it from another project… maybe I have to publish it. How can I do?

pub

Thanks to all, I’ve understood and checked but "Publish mode is “Auto”, therefore when project is saved is also automatically published.
This is the code in a script :

and this is the Named Query:
img2

If executed in the Designer it works perfectly, but after saved the project and published, the query won’t be executed leaving an error message as below:

Traceback (most recent call last):

File “event:actionPerformed”, line 10, in

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Named query LoroPiana/getLottiList not found

caused by GatewayException: Named query LoroPiana/getLottiList not found
caused by GatewayFunctionException: Named query LoroPiana/getLottiList not found

Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_251

Try

DS=system.db.runNamedQuery("ProjectName", path, params)

note also capitalisation, the g in get should be Get for GetLottiList

I’ve tried this :

but it doesn’t work
this is the error :

Traceback (most recent call last):

File “event:actionPerformed”, line 10, in

java.lang.ClassCastException: java.lang.ClassCastException: Cannot coerce value ‘LoroPiana/getLottiList’ into type: interface java.util.Map

caused by ClassCastException: Cannot coerce value 'LoroPiana/getLottiList' into type: interface java.util.Map

Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_251

If it works in designer I don’t think this is the cause, but worth a try, fix that capital G

OK so think that error is caused by adding the project name.

Where/how are you calling the script?

Fix the G regardless

Solved!!!
A very stupid error but strange behavior:
I named the query getLottiList but I wrote GetLottiList in the function; in Designer worked fine but not in the client.

Thanks a lot Matrix_Engineering!!

2 Likes