I'm using an SFTP connection ---------------------...
# suitescript
s
I'm using an SFTP connection ------------------------------------------------------------------------------------ var connection = sftp.createConnection({ username: 'NetSuite', secret: '.....', url: '...', hostKey: myHostKey }); var lists = connection.list({ path: 'INBOUND ORDERS', sort: sftp.Sort.DATE_DESC }); -------------------------------------------------------------------------------- The folder has 9000 files. The connection.list return the first 5000. Do you know a trick to return everything ?
r
Those hard limits mean you should probably look at using a paged result set
s
Paged result set, not sure what it is. I don't see anything in SuiteAnswer.
r
I’ve not used the sftp module to advise, but one way could be to create a check in your code for if you’ve reach 5000 records, create an identifier for that point, then change your query to exclude previously received records. (IE, date equal to or older than current records date then skip the result set until you get back to the record you left off on) In other words, if it is over 5,000, then you will need to reduce your result list set size. I don’t have the api docs open atm to provide direct options, but hopefully this can help steer you the right way 🤷‍♂️
w
Doesn't look like Connection.list() has any options for query-parameters. Could you move files that are processed to another folder? so that you don't reach that limit.
👍 1