Creating Script for MassUpdate

Hi,
I am trying to update a bank payment format in bulk for specific vendors. I couldn’t fine a correct CSV record type for this filed, hence I thought I need to use mass update and need to create a script for it. But I am not very familiar with scripting, would anyone be able to help?

Thank you

Beginner Asked on April 3, 2023 in SuiteScript.
Add Comment
2 Answer(s)

Yes, I can certainly help you with creating a script for mass updating bank payment formats for specific vendors in NetSuite.

Here are the steps you can follow:

    1. First, create a Saved Search to identify the vendors for which you want to update the bank payment format. You can use various criteria in the Saved Search to filter the vendors, such as location, subsidiary, vendor category, etc. Make sure to include the internal ID of the vendor in the search results.
    2. Once you have the Saved Search, go to Customization > Scripting > Scripts > New to create a new script. Choose the Client Script type.
    3. Set the script’s Name and ID, and select the appropriate API Version.
    4. In the Script record, go to the Script Deployment section, click on New to create a new deployment, and select the Saved Search you created in Step 1 as the deployment criteria.
    5. In the Script record, go to the Script tab and write the script to update the bank payment format for the vendors returned by the Saved Search. Here is some sample code you can use:
      function massUpdateBankPaymentFormat() {
      var vendorSearch = nlapiLoadSearch('vendor', 'YOUR_SAVED_SEARCH_ID_HERE');
      var searchResults = vendorSearch.runSearch();
      searchResults.forEachResult(function(searchResult) {
      var vendorId = searchResult.getValue('internalid');
      // replace YOUR_FIELD_ID with the internal ID of the field you want to update
      nlapiSubmitField('vendor', vendorId, 'YOUR_FIELD_ID', 'YOUR_NEW_VALUE');
      return true;
      });
      }

 

 

    1. Replace the YOUR_SAVED_SEARCH_ID_HERE, YOUR_FIELD_ID, and YOUR_NEW_VALUE placeholders with the appropriate values for your specific use case.
    2. Save and deploy the script.
  1.  

 

Once you have deployed the script, you can run it by going to Lists > Mass Update > Mass Updates > New. Select the script you just created, and follow the prompts to update the bank payment format for the vendors returned by the Saved Search.

TROY OLTMANNS

 

NETSUITE TECHNICAL ARCHITECT

 

 

 

(p) 949.238.6900

 

(f)  949.271.4635

 

www.TREVERA.COM

 

 

 

Check out our open opportunities at: http://public.bullhornstaffing.com/JobBoard/Standard/default.cfm?privateLabelID=5253

 

Beginner Answered on May 11, 2023.
Add Comment

Sorry for the delayed response – thank you very much for this. Tested and it worked!

Beginner Answered on May 18, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   SuiteMigration   Become a Sponsor