How to retrieve from multiple entities?

0
Hello. I am trying to make the Page as shown below. And, Domain Model is as follows. In the past of development, I was using a SQL as follows. But DataGrid of Mendix can't use SQL... SELECT student_name ,school_name ,team_name ,assign_start ,assign_end FROM ((student INNER JOIN school ON (student.school_id = school.id)) INNER JOIN assign ON (school.id = assign.school_id) INNER JOIN team ON (assign.team_id = team.id) ) WHERE student.student_name like ... AND school.school_name like ... AND team.team_name like ... AND assign.assign_start <= ... AND assign.assign_end >= ... I have 2 questions. Q1 I'd like to know how to realize the Page and to retrieve from multiple entities. Q2 Do you know some way to use SQL(ex. Using Joins, Sub Queries) in Mendix?
asked
3 answers
1

A1: You could add 2 non-persistent entities, one with the search attributes and one with the grid columns as attributes and on opening the form create search-entity-record. On search run a microflow that populates the grid-entity-records that all have an association with the search-entity record.

A2: For reports you have OQL, so you could use a report grid as well

answered
0

Thank you for your help.
It was possible to progress a little. And I still have question.
I'd like to ask you about populates the grid-entity-records.

At this time, I created microflow as below.

  1. Retrieve "Student" list.
  2. Create result list which is GridEntityList.
  3. Refill the StudentList to the GridEntityList.
  4. Return the GridEntityList.

alt text I think I want to retrieve School, Union and Assign data together.
But I couldn't understand how to retrieve multiple entities.

Therefore, we do not see only the name of the student on the page.

alt text

Q How to populates the grid-entity-records?

answered
0

In the loop retrieve the school and union taking the first record found (I assume it is not many to many, if so you create multiple student records in grid entity for the same student with different school/union)

answered