Flat File Export - Data is not ordered

0
Hello All,   I am using Flat & Delimited File Export module from Appstore. I see downloaded data is not in order. I see a post similar to this, https://community.mendix.com/link/questions/86497 But what was the change is not mentioned here. Can some one know what needs to be done (other than adding a column only to sort)? Thanks in advance, Nirmal
asked
1 answers
0

Add this anonymous class to the code:

private static Comparator<IMendixIdentifier> MXIDCOMP = (final IMendixIdentifier i1,
			final IMendixIdentifier i2) -> (int) (i1.toLong() - i2.toLong());

The in the code add the sort like below:

//Check if defined reference set could be found
		if(!refset.equals(null)){
			List<IMendixIdentifier> objs = refset.getValue(getContext());
			objs.sort(MXIDCOMP);

To sort the list based in the identifiers (ID’s) then the rest of the code should handle the export in this order.

Be aware this I have not tested this code yet, but it might provide you with some direction.

answered