Many-to-Many records

Many-to-Many records

Good Evening, I am designing a system for a school.
I have two main tables, students and classes.

I created the table as detailed in the link:

I created the pages as the default

I'm having trouble creating a page to list the records. Both the students who are in a respective class, when students in that class is.

And my main difficulty, which is not found in any tutorial is how do I create a page where he edited a student, and itemize the various class that it is registered.

Sending attached the working file, and if you can help with links to tutorials or help on how it should be done.

Sorry for english. I'm Brazilian.

very thanks

Luiz Diniz

Hi Luiz,

To list the classes in which a student is in, you can add a Table Records to the Aluno_Edit screen - the list of classes of the student should be retrieved in the preparation of the screen from the Database.

To add the list of classes to the Aluno_Edit screen , you simply have to drag the entity Turma to the screen. This will automatically create the GetTurmas query on the preparation of your screen and the TurmaTable that list of Classes on the screen. Having this done, you will simply have to change the GetTurmas query in the preparation to get the classes of the specific student that you are seeing on screen.

To add a class to a student, you should create add an additional operation to your Aluno_Edit screen in which the User can select a class tand add it to the student. This can be done in several ways - with a simple drop down list and an Add button, in a popup window (using the RichWidgets Popup_Edit web block)or etc. . Attached you can see an example of how the add class operation was also added to the screen (with the AdicionarTurmaEdit and the AdicionarTurma screen action). Of course, you cam write any business logic that makes sense in your case to add a student to a class (it should be in the AdicionarTurma screen action)

Kind Regards,

Daniel Lourenço