Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Cant create file via suitescript 2.0
Hello,
Just wondering if anyone else has seen this.
I'm trying to create a file via a restlet with the following code:
require(['N/file'], function (file) {
var fileRequest = {
name: 'test' + '.txt',
fileType: file.Type.PLAINTEXT,
contents: 'test',
encoding: file.Encoding.UTF_8,
description: 'test',
folder: 165
};
try{
var file = file.create(fileRequest);
}
catch(ex){
debugger;
}
var fileId = file.save();
});
But everytime i run this i recieve an error with the following message: 'Unexpected Error'.