I want (in a grib and in a form app) to change the main SQL statement - but only WHERE condition.
So let’s imagine the grid app with main SQL statement (in SQL settings) like this:
SELECT
column1,
column2
FROM
sometable
This is like always.
But then I want to add a condition WHERE.
But I want the condition to be calculated in the same aplication.
So logical would be put a code like this:
{where_statement} = "result of some very complicated calculations";
into onLoad event. Right?
And then change the initiating SQL to this:
SELECT
column1,
column2
FROM
sometable
WHERE {where_statement}
On some reason SC erase all local vars and nothing goes through so the SQL gives error.
I’ve checked and Global variable would work if was set up before eg. in other app but I don’t like that idea - it’s not elegant and leads to producing many unnecesarry blank or control apps.
Is there a way to archieve my goal?