how can Add membership_groups and membership_users as dropdown list ?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
xbox2007
Veteran Member
Posts: 136
Joined: 2016-12-16 16:49

how can Add membership_groups and membership_users as dropdown list ?

Post by xbox2007 » 2023-12-29 15:32

hello
good evening everyone
i would like ask how can can add membership_groups and membership_users as dropdown list on My appGini detail view ?

thanks a lot

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

Re: how can Add membership_groups and membership_users as dropdown list ?

Post by onoehring » 2023-12-31 10:13

Hi,

afaik, you can only add usergroups and users from the admin area.
Of course you can build a usermanagement yourself and draw data from AG's own tables and write data back to those tables once changes have been done.

Olaf

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

Re: how can Add membership_groups and membership_users as dropdown list ?

Post by pbottcher » 2023-12-31 12:26

Hi,

maybe you can explain a bit more what you try to achieve.
Per default, those tables are not accessible via the normal AppGini settings. So what you can do is create 2 new tables within AppGini and mirror the setting of the membership_groups and membership_users tables. Then, after generting your app you could drop those tables via sql and create a view towards the original tables. With this you can use the entries from the membership_groups and membership_users tables within the AppGini tables that you generate.
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.

xbox2007
Veteran Member
Posts: 136
Joined: 2016-12-16 16:49

Re: how can Add membership_groups and membership_users as dropdown list ?

Post by xbox2007 » 2024-01-03 13:35

Dear onoehring , pböttcher
thanks a lot for your comment ,
actual that what i do now i make two tables for group and users

i use this table to add new group and new user for my App

thanks a lot

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

Re: how can Add membership_groups and membership_users as dropdown list ?

Post by onoehring » 2024-01-03 14:09

Hi,

so go ahead like pböttcher suggested. Look at the internal AG tables for groups and users and set up clones of them. Now you can built on that (adding records = adding users, assigning users to groupd etc.)
Then, simply use hooks (after_update, after_delete, after_insert) to synchronize "your" user/group tables with those of AG: Use SQL to

Code: Select all

// pseudo code
update AG_groups ( select * from YOUR_groups )
insert into AG_groups ( select * from YOUR_groups )
update AG_users ( select * from YOUR_users )
insert into AG_users ( select * from YOUR_users )
PS: You probably want to sync groups first.

Olaf

xbox2007
Veteran Member
Posts: 136
Joined: 2016-12-16 16:49

Re: how can Add membership_groups and membership_users as dropdown list ?

Post by xbox2007 » 2024-01-13 11:37

Dear onoehring , thanks a lot

Post Reply