is there a way to order sublists on a transaction ...
# suitescript
n
is there a way to order sublists on a transaction via scuitescript? I have a map/reduce and I'm using the reduce phase -> in the map the search results are in the correct order but when I write those results to a sublist on a transaction (SO) it reorders them.. how do I keep the original order?
@battk
b
running things in order is not usually a strength of parallel scripts
probably best to number your search results so you can sort them later
n
good call, how do I number the search results?
I'm basically creating my key & values and passing the results to the reduce phase.. would you recommend having a column in the SS be part of the values and then somehow sorting with that?
whats strange is that I added formula(numeric): rownum to see what the row numbers were... they are all jumbled up and don't seem to take my sorting into consideration (the results are actually sorted the way I want them.. but somehow the rownum are all messed up)
b
depends on how you have ordered your columns and how easy it is to assign numbers to them
if you want to go the analytic route, you can use ROW_NUMBER
sorting in your reduce code can work too
n
ok thanks @battk I did a not very elegant sorting using for loops