Binding Errors on Evaluation Order

#1

When opening a window or template in the Designer, the SQL binding executes before the parameters have been evaluated, leaving errors similar to:
caused by GatewayException: Connection Error: Datasource “-1” does not exist in this Gateway.
caused by SQLException: Datasource “-1” does not exist in this Gateway.

It works fine in the Client. Any suggestions to cleanup this nuisance error?

1 Like

#2

I have a similar problem that does effect the client. I am trying to get the primary key of the selected row of a table with:
if({Root Container.Table.selectedRow} >-1 ,
{Root Container.Table.data}[{Root Container.Table.selectedRow},“task_id”],
-1)
But I get a null pointer error because selected row has not updated yet and it is using the value I last saved the window with. No error if I saved the window with nothing selected (slectedRow = -1), but pointer errors if I saved the table with a row selected (selectedRow >-1). I don’t want to have to save the table unslected every time I make an edit. Is there a way to make sure this binding does not execute until the table’s selected row has been evaluated?

0 Likes

#3

I tried handling this with a script when then window opens, but what i found is my connections/tags just got evaluated twice.

Still no clean solution that I’ve come across

0 Likes

#4

I am curious if you found a clean way to handle this situation.

0 Likes

#5

Unfortunately, no. We still get a lot of errors - but only in the Designer

1 Like

#6

Wrap the expression in a try() ?

0 Likes

#7

Sometimes this also happens to me in the designer when I try to make a simple query where I pass parameters. To solve it first I do the format of the string of the query and then I pass the string to the runquery method.

query = "SELECT * FROM report_configuration WHERE id=%s" % (i)
reports = system.db.runQuery(query)
0 Likes