Page 1 of 1

Only 5 rows to show

Posted: 2020-05-03 08:07
by fciprian
Hello
And thank you again for all your work!

Can anyone help me with this ? I have a table with 100 rows. And i want only last 5 rows to be showen for all groups that i grant access to view. And only the admin to see all rows.
Is that possible?

Thank you verry much!

Re: Only 5 rows to show

Posted: 2020-05-03 19:16
by pbottcher
Hi,

short answer. Yes.

You can do this in the hooks/tablenmame.php --> init function by modifying the options->QueryWhere to your needs.

Also you should add a check to the dv function, if the user would try to call a direct record that he/she is not allowed to.

Re: Only 5 rows to show

Posted: 2020-05-04 09:58
by fciprian
Hello and thank you for the answer.

I can not see any QueryWhere in hooks/tablenmame.php (tablename is my table)
I need to insert new row?
Please can you guide me? I apriciate.

Thank you

Re: Only 5 rows to show

Posted: 2020-05-04 13:14
by onoehring
Hi,

check out this page: https://bigprof.com/appgini/help/advanc ... ist-object
but, you will not find queywhere there either. You can use the code on the bottom of the page to see all data options available - and there you will see querywhere.
You should check (where pböthcer suggested) for the current user. If that is the admin - fine. If not, just define a querywhere. I would suggest something like adding " 1=1 LIMIT 5" (not tested)

Olaf