List Operation Find By ID (using a reference) - Mendix Forum

 List Operation Find By ID (using a reference)


It would be useful if we could use references in the List Operation activity for example in the Find operation.

I think the only thing that needs to be added is the possibility to select something as ID In the Member drop down.


Use case

This is helpful in situation where you want to optimize performance. Let illustrate this with an example. Say I have Member and a MemberType entities in my domain model. As you can imagine I will have many Member objects and only a few types. Say I need to retrieve the MemberType of a Member and do some calculations using information stored in the MemberType. What you see happening now is that you retrieve all Members and in a loop retrieve the MemberType for every Member. This will create a lot of stress on the database. Another option would be to just retrieve alle the MemberTypes and lookup the MemberType in this list. This is currently not possible (without using Java). So being able to find an object in a list based on its ID and a reference from some object would be nice. The GUID of the outgoing associations are stored in the MendixObject anyway, so the information is available and I have create two Java actions to retrieve the GUID of a reference and lookup the an object in a list given its GUID.

1 answers

Definitely a must-have for performance upgrade!

I'm looping over a large list and need to retrieve an object over association, which causes lots of database calls, while the possibilities of referred objects is just a small list! It would be very nice if I could just retrieve the small list at once and find the referred object from the list in the loop.