Retrieve Object Filtering

0
Hi Guys,   I have an Employee table, each employee has a Department and a Division which they work in.   At some point I will get a list of Departments I want to retrieve employees for, so this is a dynamic list of departments.   Now I want to retrieve the employees only for the departments in the list I have.   The way I see it I have these options: 1)  OQL : Install OQL and write a custom query to get this data back 2)  Retrieve the full list and loop through to do a find operation, and only add to the list if the department is found.   The loop is not efficient, so I just wanted to know what is the best way to retrieve data from the database, using a list. It's like doing a SQL statement where I select from employee table where department IN (myList).   So can anyone advise on what is the best way to achieve this in Mendix using the standard functionality.
asked
1 answers
0

Hello Deon,

 

What also can be option is to loop over the list of departments and retrieve the list of employees par department and add these employees to a list of employees.

 

Hope this helps,

 

Good luck!

answered