netsuite - How to upload to file cabinet similar with UI's "Attach from Web" using suitescript? -
using image type custom field in netsuite, users can add new file file cabinet following settings in ui: attach = "web" url = "file's url"
can same using suite script?
yes, here sample code using suitelet.
if(request.getmethod() == 'get') { var form = nlapicreateform('test upload', false); form.addfield('custpage_upload_file', 'file', 'upload', null, null); //upload control form.addsubmitbutton(); response.writepage(form); } else { var file = request.getfile('custpage_upload_file'); file.setfolder(-4); var id = nlapisubmitfile(file); }
Comments
Post a Comment