How to use username/id in lookup?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

How to use username/id in lookup?

Post by onoehring » 2019-05-22 13:27

Hi

I see, I can automatically add the username to some field.
How can I use the username / ID / GroupID ... some other internal AppGini placeholder in my custom SQL code (e.g. for an advanced lookup)?

Olaf

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

Re: How to use username/id in lookup?

Post by jsetzer » 2019-05-22 13:31

Create a view "view_members" using your SQL tool. Add a table "view_members" to appGini with identical columnnames and data types. Use the table as lookup source. Generate your app.
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

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: How to use username/id in lookup?

Post by onoehring » 2019-05-22 15:55

Hi jsetzer,

thanks for this suggestion. Sounds good. I will try it.
Olaf


pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: How to use username/id in lookup?

Post by pbottcher » 2019-06-05 07:03

Hi,

not sure if this is what you are looking for, but if yes, this is not yet supported. See

viewtopic.php?f=2&t=2880&p=9627&hilit=lookup#p9627
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.


User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: How to use username/id in lookup?

Post by onoehring » 2019-06-20 09:27

Hi Jan,
jsetzer wrote:
2019-05-22 13:31
Create a view "view_members" using your SQL tool. Add a table "view_members" to appGini with identical columnnames and data types. Use the table as lookup source. Generate your app.
Works, but AG complains as PK can not be FK at the same time (according to AG) and FK can not be UNIQUE (according to AG). I did like AG wanted and changed the table indexes in phpmyadmin accordingly. AG could also warn the user if that what he tries to do actually makes sense, and then follow instructions ... :roll:

Olaf

Post Reply