I have a custom recordset that I am trying to search for the next available record that has a field that is blank. In SQL, I would use TOP or MAX or MIN... How can I do this in a suitescript search (v2)? So that I do not get thousands of records?
b
battk
06/18/2019, 1:00 AM
you don't really need to, both of the main search mechanisms (ResultSet and PagedData) have ways of controlling how many results you get at a time
s
Scot Sunnergren
06/19/2019, 4:56 PM
yes, but I have specified .runPaged({"pageSize": 1}) on my request and I get the LAST record in my table instead of the first. even though I tried sorting on both the internal id and another record ASC
b
battk
06/19/2019, 5:17 PM
if you are desperate, you can try using summary columns
battk
06/19/2019, 5:17 PM
id prefer to see the code first before making that change