Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Create subform for bridge table whit 2 foreign key

Questions related to using nuBuilder Forte.
Post Reply
jaimeandres3
Posts: 16
Joined: Thu Jul 22, 2021 4:10 pm

Create subform for bridge table whit 2 foreign key

Unread post by jaimeandres3 »

Hello.
I have 2 foreign key in table materiasa
I create subform, nuBuilder need a primary key.
How can I make the subform for table materiasa?
Attachment designer and structure tables.
You do not have the required permissions to view the files attached to this post.
nac
Posts: 115
Joined: Tue Dec 12, 2017 11:28 pm
Location: Aberdeen, UK
Has thanked: 9 times
Been thanked: 12 times

Re: Create subform for bridge table whit 2 foreign key

Unread post by nac »

Hello jaimeandres3,

I hope I have understood your question correctly.

Your table 'materiasa' looks like the link in a many-to-many relationship between 'materias' and ' alumnos'. You would probably need to have two separate parent forms with a subform for materiasa in each. Have you tried to make a simple wireframe of what you want the forms to look like? That could help to clarify what views you will need to create.

You can use views as the data source for a subform. The view needs to be updatable if you want to edit and save the objects in the subform. You can read about updatable views at https://dev.mysql.com/doc/refman/8.0/en ... ility.html

Make sure that the view contains the primary key for the table (in the view) that you wish to update and use this for the primary key in the form design.

You can check if your view is updatable by running:

Code: Select all

SELECT table_name, is_updatable FROM information_schema.views;
Neil
Post Reply