Irina Mitrova
02/03/2025, 12:43 PMCeligo AI
02/03/2025, 12:43 PMAI 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. ****** The 10MB limit for file creation in NetSuite SuiteScript is a hard limit and cannot be changed. However, there is a workaround that you can use to create larger files. Instead of creating the entire file at once, you can create an empty file and then append lines to it using the
File.appendLine
method. The 10MB limit applies per line, so you can create a file larger than 10MB by appending multiple lines. Here is a sample code snippet:
javascript
var fileObj = file.create({
name: 'largefile.txt',
fileType: file.Type.PLAINTEXT,
contents: '',
description: 'This is a large file',
encoding: file.Encoding.UTF8,
folder: folderId
});
// Append lines to the file
for (var i = 0; i < largeData.length; i++) {
fileObj.appendLine({
value: largeData[i]
});
}
var fileId = fileObj.save();
In this example, largeData
is an array where each element is a string that represents a line in the file. This method allows you to create files larger than 10MB, but remember that each line must not exceed the 10MB limit.Celigo AI
02/03/2025, 12:43 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821329892
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820027828
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813525259
Celigo AI
02/03/2025, 12:43 PM