Page 1 of 1

Run time variables in DV & TV

Posted: 2023-05-27 16:35
by compusoft
Hi

It would be desirable to be able to have variables (PHP or AppGini) that could be used in "Advanced Lookup Options" In this way we could customize our queries. ej:

'select * from table_name where date = ' + 'hereMyVar' + 'rest of my query'

hereMyVar would be fully defined by either jQuery or PHP code.

Re: Run time variables in DV & TV

Posted: 2023-06-06 05:40
by onoehring
Hi,

yes, I agree, that this would be a great feature.
Olaf

Re: Run time variables in DV & TV

Posted: 2023-06-06 06:15
by jsetzer
customize our queries
Actually, I'd prefer a hook.

Reason: if we had variables in Advanced Query Editor, we would have to generate code on any small change and even if our SQL query was buggy. That's annoying, if you ask me. It takes minutes every time.

But if we had PHP hooks for lookup queries, we could evaluate request parameters, check permissions or fetch any other data we need and then return a SQL command or even an array { id, text }.

From my perspective this would be...
  • easier to implement for BigProf
    (just a function_exists evaluation)
  • backward compatible
    (nothing changes if hook does not exist)
  • easy to use for us
    (hey, it's PHP)
  • faster in development
    (because we don't need to re-generate code each time)
  • better to test
    (we just have to change code and then open dropdown control, which will automatically fetch data from the server, using our latest changes)
  • super-flexible and much more powerful than a handfull static variables
    (because we can decide what to return)
Just my 5 cents.