Chris
03/21/2025, 2:57 AMCeligo AI
03/21/2025, 2:57 AMAI generated answer (using internal Slack threads):Based on the conversations, the error
INSUFFICIENT_PERMISSION
you're encountering could be due to several reasons:
1. Role Permissions: Even though you mentioned that you have full rights, it's worth double-checking your role permissions. Make sure that your role has the necessary permissions to perform the operation. In this case, you should have the 'Lists -> Documents and Files' permission.
2. File Overwrite: If you're trying to overwrite an existing file with the same name, there could be issues. As per the conversations, it seems that NetSuite doesn't allow directly overwriting the contents of an existing file. Instead, you need to delete the old file and create a new one with the same name.
3. File Size: If the content you're trying to write to the file is too large, you might encounter the SSS_FILE_CONTENT_SIZE_EXCEEDED
error. Make sure the content size doesn't exceed the limit.
4. Error Handling: Make sure to include error handling in your script. Using a try/catch block can help you catch and handle any errors that might occur during the execution of your script.
Here's a sample code snippet based on the conversations:
javascript
var fileType = file.Type.PLAINTEXT;
var folder = <FOLDER ID>;
var name = 'test.txt';
file.create({ fileType: fileType, folder: folder, name: name, contents: 'First' }).save();
file.create({ fileType: fileType, folder: folder, name: name, contents: 'Second' }).save();
file.create({ fileType: fileType, folder: folder, name: name, contents: 'Last' }).save();
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
03/21/2025, 2:57 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851634264
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84836942
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845361471
Celigo AI
03/21/2025, 2:57 AM