How can I create a linked list in Mendix?

0
I have a list of non persistent entities in Mendix. How can I turn this into a Linked List? I can create a self-association "Next" in the data model, but I  do not know how to create the entries. Normally I would create a variable to the "Previous" object and in the loop do the Mendix equivalent of    $Previous/Next = $Current; $Previous = $Current  However, in Mendix I cannot re-assign an object reference.   
asked
1 answers
0

Hi Hans,

What if you sort your list view by created date? Then in a microflow, you can pass your selected object, retrieve the non-persistent list, sort the list, and then iterate the non-persistent list, use an exclusive split to match your paramter object to the objects that you are iterating, if you get a match, set a flag, then some how use a variable to uniquely identify the next object, use a break to end the iterator, and then use the list operation find to retrieve the single object out of your list and show the next detail page. 

 

Edit: Here is an example microflow. Not sure if this is the best way to do this. 

https://modelshare.mendix.com/models/d6b2d889-fea4-492f-86f6-89fedbe6e27c/example-find-next-object-in-list-based-on-created-date

answered