Thursday, February 28, 2019

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')
   {
      var form = nlapiCreateForm('Upload File');
   var fileField = form.addField('file', 'file', 'Select File');
      fileField.setMandatory(true)  
      form.addSubmitButton();
      form.addResetButton();
      response.writePage(form);
   }
   else
   {
    
        var file = request.getFile("file")
       file.setFolder(166); //internalid of Folder
  var id = nlapiSubmitFile(file);
 
  }
 
var form = nlapiCreateForm('Upload File');
var 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.

 

No comments:

Post a Comment