Hi,
Apologies if this has been answered before (I couldn't find it by searching).
How does AppGini implement junction tables? I have used these to do my many-to-many relationships in my database.
http://en.wikipedia.org/wiki/Junction_table
I would like a button similar to the existing 'Display a link to children records from' option in AppGini but that gives me all the matching records from the other non-junction table. E.g. Using the example given by wikipedia, I would like a button on the User table detail view that takes me to a view of the corresponding Permissions records, without needing to interact with the UserPermissions table in between.
Am I missing something or this more difficult?
Junction Tables
Re: Junction Tables
I am looking for the same thing. Thanks for your post, but I haven't found an answer either.
Re: Junction Tables
Any ideas devs? It has been 8 days with no reply. Is this product still supported?
Re: Junction Tables
All you need to do is follow the example in the Wikipedia page you mentioned .. just create 3 tables, one of them containing 2 lookup fields, one for each parent table ... now under the users table, you won't see a list of permissions from the permissions table, but rather a list from UserPermissions table (the junction table) .. However, you can configure the lookup field in UserPermissions to display the PermissionDescription value rather than the PermissionKey value by setting the parent caption field to PermissionDescription.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Junction Tables
Hi Ahmed,
Thanks but this doesn't provide the single click button on the User table detail view that takes me to a view of the corresponding Permissions records. It only gives me a view onto the intermediate table and so you have to click again to begin editing.
I ended up making a clone of Permissions_view.php called Permissions_view_User.php. Permissions_view_User.php takes the UserID and returns a table view of all the Permissions associated with the UserID. I also have to edit the User_templateDV.php to include a button for Permissions_view_User.php.
I am surprised that Appgini doesn't have a built in feature for this given how common many-to-many relationships are in databases.
Thanks but this doesn't provide the single click button on the User table detail view that takes me to a view of the corresponding Permissions records. It only gives me a view onto the intermediate table and so you have to click again to begin editing.
I ended up making a clone of Permissions_view.php called Permissions_view_User.php. Permissions_view_User.php takes the UserID and returns a table view of all the Permissions associated with the UserID. I also have to edit the User_templateDV.php to include a button for Permissions_view_User.php.
I am surprised that Appgini doesn't have a built in feature for this given how common many-to-many relationships are in databases.
Re: Junction Tables
Any word on this? Without a way to do M2M it is almost impossible to create realworld applications.