<@UCLB7CN67> thanks. Does this look correct to you...
# suitescript
s
@Nik thanks. Does this look correct to you? Am I correct in using
context.values[X]
to access the row values?
n
You might wanna log the values and see if you are getting the correct data. Also, I would suggest loading only 10 records for testing purpose first so that you don't go into processing 20k records and run for a very long waiting period
If you have problems with values, you may use :
function getInputData() { var rows = []; var f = file.load({ id: 'SuiteScripts/CSV/serial_expiries.csv' }); var contents = f.getContents(); // Important: This method is only supported on files up to 10MB in size. var lines = contents.split('\n'); // start at row 1 to ignore headers for (i=1; i<lines.length; i++) { var line = lines[i].replace('\r', ''); var values = line.split(','); // TODO: check correct number of columns in row // Expects CSV format to be internal_id, itl_lot_id, dbs_expiry, sck_expiry // Do these need to be key value pairs or just an array? rows.push({internalId: values[0], itlLotId: values[1], dbsExpiry: values[2], sckExpiry: values[3]}); } return rows; }
s
Ok thanks 🙂 I'll give it a go
n
Lemme know how it goes 🙂
s
@Nik thanks. Its going ok, for some reason its saying alot of the internal ids dont exist which is weird (I obtained these ids from a saved search on Inventory Numbers). So they should exist and be editable.
n
That's weird, Can you get one o those and try browsing it. See it's not inactive or something