Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
File upload suitelet
Ok, I am part way to creating a really rather cool suitelet that allows customers (who are logged in) to upload files and attach them directly to their entity record.
The code i am using is:
function uploader(request, response) { if (request.getMethod() == 'GET') { var form = nlapiCreateForm('Attach File to Customer', false); var entityField = form.addField('entity', 'select', 'Customer', 'customer'); entityField.setLayoutType('normal', 'startcol') entityField.setMandatory(true) var fileField = form.addField('file', 'file', 'Select File'); fileField.setMandatory(true) form.addSubmitButton(); form.addResetButton(); response.writePage(form); } else { var entity = request.getParameter("entity") var file = request.getFile("file") // set the folder where this file will be added. In this case, 10 is the internal ID // of the SuiteScripts folder in the file cabinet file.setName("file" + entity + ".jpg") //set file name file.setFolder(4) // now create file and upload it to the file cabinet. You must use nalpiSubmitFile 0