hello I am working on writing a file script, while...
# suitescript
m
hello I am working on writing a file script, while uploading script got this error Fail to evaluate script: {"type":"error.SuiteScriptModuleLoaderError","name":"UNEXPECTED_ERROR","message":"missing ; before statement (SS_SCRIPT_FOR_METADATA#20)","stack":[]} script: /** *@NApiVersion 2.x *@NScriptType Suitelet */ define(['N/file', 'N/record'], function(file, record) { // Create a file containing text var fileObj = file.create({ name: 'MH_writefile.txt', fileType: file.Type.PLAINTEXT, contents: 'Hello Netsuite\nHello Pakistan' }); // Set the folder for the file fileObj.folder = 293909; // Save the file let id = fileObj.save(); // Load the same file to ensure it was saved correctly fileObj = file.load({ id: id }); });
b
NApiVersion 2.x is too ambiguous, use either 2.1 or 2.0
you script also isn't a valid entrypoint
start at a SuiteScript 2.x API Introduction before writing your first script
r
m
@Ramanand Dubey this link is not working
r
Yes I know, you should replace the "ACCOUNT_ID" keyword to your account id form the url.
works too
m
thanks both of you let me check