How to display TableRecords with n-n relations to itself?

How to display TableRecords with n-n relations to itself?

  

Hello All!

Let's say I need to store and manage people names and relations between them. I can create an entity Person (with PersonId, Name, etc.) and also entity Relation (with RelationId, Person1_Id, Person2_Id, RelationType, etc.) and store all I need in this way.

Question is how to build a form similar to Detail Screen for Person Entity but with TableRecord contiaing relatives in a container below? Same question for Relation From at Relations Detail Screen...

Ideally it would be good to build required UI with standard Outsystems blocks like TableReords and Aggregate, and without dynamic SQL and Javascript. 

Thanks!

Yuri

Hi Yuri,

You can use ListRecord and inside that you can place webblock according to your need to see the details or related record , you just need to paas the parent id in the webblock and in webblock you can write code to get related record based on the id you provided.


Regards

-PJ-

Hi Pramod,

thank you, that's an interesting idea. But can we stay with two related TableRecords (or ListRecords if you like) just for simplicity.

Main thing here is that I need to put in one ListRecord two independent lists: rows from Relation entity where Person1_Id = <PersonId from parent list> and then rows from Relation entity where Person2_Id = <PersonId from parent list>. So basically I need to make a Union operation in terms of SQL...