Grid column sort bug

Two problems occur when I try to sort a grid by a column:

Problem 1: ScriptCase produces illegal SQL by placing “order by Some_Column asc, limit 0,22” at the end of the generated SQL. (The asc, limit is the problem, or rather, the comma is)

My SQL is very simple: “SELECT *,COALESCE(Join_Date,“Not A Member”) FROM T_Users”
It kind of works. The grid looks as it should. If I try to sort on a column, I get the SQL error above.

Problem 2: (related to Problem 1) the error dialog that pops up shows me raw HTML code for what might be a reasonable error dialog in another galaxy. (Firefox, Chrome, and Brave) I like the HTML but my users will think it looks really buggy and not at all the quality they paid for.

are there some fields where you use the lookup function?

I remember having a similar problem caused by the value of the lookup. May be you can remove all lookup and see if it still happens

Keep us informed :slight_smile:

That was a great idea. I do have manual lookup fields, 0/1 to yes/no stuff. I removed the manual lookup fields and it still throws the same error. So I stripped it down to two fields that are this-table-only values, both set to sort-able columns. Same error.

Good idea though. Thanks.

This is a bug. A serious bug.

if I’m sorting on a column, there is no way the generated SQL should contain a comma after the sort clause, since there can only ever be one sort statement from a column sort. It might be ASC or DESC, but there will never be a multi-column sort from clicking the header.

This all started because I needed to change the SQL for this grid. The SQL setting seems to be extremely dodgy in ScriptCase. Has anyone ever seen a list of things to avoid in SC SQL settings? Or better, a list of things that will definitely work, as that will be a short list?

SOLVED via nuclear option.

The application was corrupted by ScriptCase with, I suppose, the last update. I recreated the application from scratch and it works as expected. Once I have all 78 field label translations back where they belong, tomorrow noon seems likely, I’ll be right back where I should have been at 7:30 this morning, $700 poorer.

The lesson: never update. Ever. Work around all the bugs from a point that doesn’t change every time you try to make a “simple 5-minute change”. Yes, never updating is a terrible idea, but it’s not as likely to make me lose money as negligent QA by a vendor.

or make a full backup of SC before updating