Page 1 of 1

How to use username/id in lookup?

Posted: 2019-05-22 13:27
by onoehring
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

Re: How to use username/id in lookup?

Posted: 2019-05-22 13:31
by jsetzer
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.

Re: How to use username/id in lookup?

Posted: 2019-05-22 15:55
by onoehring
Hi jsetzer,

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

Re: How to use username/id in lookup?

Posted: 2019-06-05 06:49
by onoehring
Hi jsetzer,

I tried your suggestion in a similar context ( viewtopic.php?f=2&t=3034 ). It did not work :-(

Olaf

Re: How to use username/id in lookup?

Posted: 2019-06-05 07:03
by pbottcher
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

Re: How to use username/id in lookup?

Posted: 2019-06-05 07:26
by onoehring
Hi pbötcher,
maybe ... we will see. Thanks for pointing out.

Olaf

Re: How to use username/id in lookup?

Posted: 2019-06-20 09:27
by onoehring
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