Search code examples
drag-and-dropworkflowfilenamesnetsuitesuitescript

Is there any way of scripting or workflowing file names of files uploaded in Netsuite?


This particularly relates to files created in Drag and Drop functionality, but applies to any file uploaded. Is it possible to use a workflow or script to create a naming convention, such as {internalID}+{date}, so that all files uploaded are named automatically to refer to the record they are attached to?


Solution

  • I use this function and I just send as parameter the name of the file

     function createfile( content, fileName) {

    var fileObj = null, fileObj = file.create( { name: fileName+ '.json', fileType: file.Type.PLAINTEXT, contents: content, description: 'TEST FILE .JSON', encoding: file.Encoding.UTF8, folder: 57, isOnline: true }); return fileObj.save(); }