Hi guys, has anyone encountered any issues with re...
# suitescript
s
Hi guys, has anyone encountered any issues with regards to the order of search results being returned? We have different results in eu1 and eu2 (SB & Prod). Was this announced?
l
I would guess that order is random, so it can be different unless you specify sorting...Additionally there is this magical checbox on record called 'Record are ordered' which may also have an impact 😉
b
order should not be random, search results are ordered by whatever sort is chosen on the columns. if none, then its sorted by internal id.
anything goes in early release 2019.1
l
I had few codes examples where creating a search withouth forcing sorting was causing data not to be sorted by id, so forcing sort in code was neccessary, so my approach is if you want to be sure add sorting in code/UI otherwise anything can happen... @battk - is sorting by id documented in help? I know it was working usually, but can't find it in help which may mean it is not a rule...
Few interesting findings: "When you define the search, make sure you sort using the field with the most unique values, or sort using multiple fields. Sorting with a single field that has multiple identical values can cause the result rows to be in a different order each time the search is run."
And for web services there is even a table with default sort by:
message has been deleted
and last thing from 2.0 (but you can understand it in few ways so it is neither confirming nor denying having default sort by internal id):
Copy code
The sort order of the column.

Use the search.Sort enum to set the value.

If Column.sort is not set, the column is not sorted in any particular order.
b
I could be wrong, usually my searches are sorted by internal id
but it looks like it is not documented anywhere
b
It seems it was the case but since it was not documented anywhere could change at any moment 🤷‍♂️
s
seems reasonable that if you want sorting, you should specify sorting, no?
l
I am requesting @kyle to create an EU channel for us. Seems to have a lot of issues going on lately.
s
Thanks for the reply guys. In most cases our experience has been that if no sort order is specified, they would be sorted by internalid by default. This was not the case recently and so we will now always sort to avoid complications. We have a case open and will update should we get any info.