Upload File to File Cabinet via Vendor Center

Currently, Vendor Center does not have standard NetSuite permission that can be customized so that they can be allowed to upload file to File Cabinet. However, a Suitelet can be deployed on Vendor Center which will function as the file upload facility. Below are the steps to work around the current limitation:

1. Create Suitelet using the following code and Deploy it to vendor Center Role:

function uploader(request, response)

{

  if (request.getMethod() == ‘GET’)

  {

     let form = nlapiCreateForm(‘Upload File’);

  let fileField = form.addField(‘file’, ‘file’, ‘Select File’);

     fileField.setMandatory(true)  

     form.addSubmitButton();

     form.addResetButton();

     response.writePage(form);

  }

  else

  {

    

       let file = request.getFile(“file”)

      file.setFolder(166); //internalid of Folder

 var id = nlapiSubmitFile(file);

 

 }

 

let form = nlapiCreateForm(‘Upload File’);

let text1=form.addField(‘success’, ‘label’, ‘Upload Succesful!’);

response.writePage(form);

  }

2. Deploy Suitelet as a custom Link on the Vendor Center Home Dashboard.

2.a. Setup>Customization>Center Categories> New

2.b. Center Type= Vendor Center

2.c. Section= Home

2.d. Category= Upload File

2.e. On Sublist link, Select the Suitelet deployment.

2.f. Label= Upload File

3. Login using Vendor Center Role and click the link “Upload File” from the Home Portlet.

Leave a comment

Your email address will not be published. Required fields are marked *