Sort list based on object ID?

Hi all, Noob question from someone with no background in programming: I'm trying to sort a list of objects which were created inside a loop. As far as I can tell, the ID's of the created objects always add up (the object created in the first iterations gets lower object ID, next one gets higher object ID and so on). If that is indeed always true, then theoretically I could sort a list of objects based on their descending ID's and head the list to get the one that was created last, right? So:  Does that make sense or should I just introduce an attribute "sequence"? If it does make sense, how is it possible? I'm not aware of any option to sort a list based on object ID's?   Thanks!
1 answers

Hi Reinout,

I don't think you can sort on the Mendix ID using the list operation activity (it may be possible with a java action). What I usually do is enable "store created date" on the entity and then sort using that.


Hope this helps!