Grid: Unable to parse global variables in the SQL statements

I’m using SC Version 9.10.020 (3)
I have a grid that works in previous versions.
In the latest version, it fails.
The SQL reads a table in the form 'SELECT field1 field2, etc. WHERE [glob variable1] Which works OK. However, if I add a second global in the form ORDER BY [Glob Variable2] it fails.
If I replace the second global with a fieldname e.g. ref it works fine.
When I try to reintroduce the global variable I get an error in the IDE:

This seems to be part of the problem… though it originally appeared as an error on the generated version, without me looking at the IDE or the app. So worked in previous versions. generated in new version and the error appeared.
I’ve tried making the global just the field name , or even the whole ORDER BY ref statement, but it has the same problem and just generates a slightly different problem at runtime.

Any ideas?

Dear @ibatey,

We carried out some tests considering more than one global variable in the Grid application’s SQL statement (in this case, in ORDER BY), and the error described in the image above was not displayed.

The test was performed on the latest version of Scriptcase (9.10.021). If possible, please confirm to us whether the error occurs in this version, and if so, provide a little more detail about the scenario used by you that requires the use of more than one global variable in the grid’s SQL statement.

Best regards!

Tested in 9.10.021 (2) and exactly the same problem.

Scenario
I have a number of items in a requirement list that I report using a single Grid. Depending upon the menu item chosen, the grid sorts by different fields. This means I have 6 or 7 reports that call the same grid, with some manipulation of the columns and different sort orders. I have successfully used this for some years.

  • On Upgrading to the latest version, I recompiled the grid, and when it ran, it gave an error.
  • On examining the error in the IDE, it was obvious that the initial SQL statement gave the error.
  • The error disappeared When I simply removed the final ORDER BY global.
    The IDE crashes back to the login screen after thie displayed error, but it does seem to save the SQL
    When you generate this revised grid, it generates a fatal error:

    For the record, the ref before the error is an echo of the global variable. I’m not sure why the error refers to a constant. It is defined as any other global variable in square brackets as per the error in the original post.

I have other grids that work fine, but none of them have the ODRER BY global!
It could be some other problem caused by the import of the grid into the new version, but I have no way to check this.

I have partially worked around it by using a groupby rule with sc_set_groupby_rule to achieve something similar without the error but really uncertain whether there is something more fundamental in the IDE.