I'm unable to download an export of a saved search...
# ask-stanley-ai
m
I'm unable to download an export of a saved search due to its size, how can I have this exported properly?
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** If you're unable to download an export of a saved search due to its size, you can use the
N/task
module in SuiteScript 2.0 to create a search task. This method can handle large amounts of data and bypass the 10MB limit that the
file.create
API imposes. Here's a brief overview of how you can do this: 1. Create a saved search in NetSuite that includes all the data you want to export. 2. Write a SuiteScript that uses the
N/task
module to create a search task. This task will run the saved search and save the results to a CSV file. 3. The script will save the CSV file in the File Cabinet. This method does not affect governance or use pagination, it just outputs the entire results as a whole. It's also worth noting that this method is very fast and can handle large amounts of data. Please note that if you need to clean, parse, or format the data from the saved search, you might need to use a different approach. If the 10MB max kicks in on save of the file you could also consider the
N/compress
library which can gzip the file prior to saving. For more detailed information and sample code, you can refer to this blog post: https://leacc.com.ph/2019/02/27/suitescript-2-0-why-you-should-check-out-n-task-searchtask/ Remember to test this solution thoroughly to ensure it meets your specific needs.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829644084
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827413678
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824736655
Please provide your feedback on this answer.