Hi, I have suitelet with sublist. Is it possible t...
# suitescript
r
Hi, I have suitelet with sublist. Is it possible to generate Excel file from sublist with all columns? Like button in saved search
e
Dont believe this can be done with native NetSuite functions, but it can definitely be done. I've done something similar in the past. Essentially you want a function that loops through the sublist lines and converts the table into a string that can be read as a CSV. Then you can add a button that downloads that CSV. example: If you had a table with 3 headers of Item, Quantity, Price.... The function would loop through lines, splitting each line with a line break, and each column with a comma like so:
Copy code
`Item, Quantity, Price
Widget A, 3, 9.99
Widget B, 5, 12.99
`
Be aware of special characters and be sure to escape any line breaks or commas as well
s
for generating CSV :
papaparse
, for getting a record sublist as a collection of objects with little-no effort:
NFT
r
Thanks!