Run time variables in DV & TV

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
compusoft
Posts: 18
Joined: 2023-05-05 09:14

Run time variables in DV & TV

Post by compusoft » 2023-05-27 16:35

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.


User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Run time variables in DV & TV

Post by jsetzer » 2023-06-06 06:15

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.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply