How to keep listbox selected items when editing a register?

Hey so I did some digging and I found a post with a similar question to mine, however their solution was tu use SQL and advanced queries. I am not very good at that and I am pretty new to OutSystems. I was wondering if there was another way.


So I have a classroom entity and several people entities linked to it via a listbox. When I edit a classroom I would like the listbox the have the people linked to that classroom already selected iniside of it instead of empty like it is now. Any sugestions?


Thanks!

Phil

Hi Felipe,


If I understand your problem, you have one entity with the rooms, and another entity with people. And you want that when you select a room, people all associated with that room appear, and each person can have only one associated room.

You create in people an attribute called SalaId, and here you always assign the room ID when the person is associated, if you have no associated room, something like nullIdentifier appears. When you choose a room, you query the People table, with a filter of type People.RoomID filtering by the room ID you want.

Regards,

Nuno Verdasca

Solution

Hi Felipe,

You will need to use an advance query.In attach an example. Check the webblock inside ClassRoomDetail.

Regards,

Marcelo

Solution

Nuno Miguel Verdasca wrote:

Hi Felipe,


If I understand your problem, you have one entity with the rooms, and another entity with people. And you want that when you select a room, people all associated with that room appear, and each person can have only one associated room.

You create in people an attribute called SalaId, and here you always assign the room ID when the person is associated, if you have no associated room, something like nullIdentifier appears. When you choose a room, you query the People table, with a filter of type People.RoomID filtering by the room ID you want.

Regards,

Nuno Verdasca

Almost nuno,

people can have more than on clasroom also, so its a many to many conection


Marcelo Ferreira wrote:

Hi Felipe,

You will need to use an advance query.In attach an example. Check the webblock inside ClassRoomDetail.

Regards,

Marcelo


Thanks! I'll do some research then!