Maintaining Roles and Data through Mass Updates


In this article, I will be discussing some useful applications of Mass Updates to maintain and update your NetSuite data and permissions.

Mass Updates allow you to make customisable updates to a user-defined dataset

For many NetSuite Administrators, the ‘Mass Update’ functionality may be a bit of an unknown, instead opting to use the CSV Import Update functionality. However, NetSuite Mass Update has some unique features that once you have experimented with, will have you coming back again and again.

The two features we will be looking at in this article are:

  • Mass Updates to maintain role permission integrity
  • Mass Update scripts and parameters

Mass Update Overview

In its simplest form, NetSuite Mass Updates allow you to create a saved search for any NetSuite record type and then specify a field to update and the value to update it to. Mass Updates can also be run according to a schedule if you wish to perform the same recurring update every day/week/month etc.

Mass Updates to maintain role permissions

One particularly useful out of the box Mass Update is the ability to update role permissions. Mass Updates allow you search for a selection of roles using your own criteria and then update those roles with a specific permission and permission level.

Why is this useful?

Mass update allows you to update the permission and permission level for several roles at once, in comparison, Roles cannot be updated via a CSV Import.

Imagine you are working in a multi-subsidiary NetSuite environment where you have a selection of roles, and for each role you have created a separate role per subsidiary. With reference to the table below, typically if you wanted to add an additional permission to the ‘A/P Clerk’ role you would open each role individually, add the permission and save.

img 1.JPG

By using Mass Updates, you can create an ‘A/P Clerk Permission Update’ Mass Update as shown in the screenshot below, allowing the user to select the “Permission” and “Level” to give each of the roles that fit a specific criteria – e.g. where the role name contains, “A/P Clerk”. You can imagine the benefits of this in a NetSuite instance with 10, 20, 30 subsidiaries.

Clicking ‘Preview’ on the Mass Update will display to you the roles that matched your criteria. These roles will be updated once the ‘Perform Update’ button is clicked.

The beauty of using mass updates for this task is that the Roles being updated are selected using saved search criteria, therefore any new roles that are created matching the criteria will automatically be included in the Mass Update.

Having created your role mass updates, your saved mass update page in NetSuite may look something like this.

Dynamic Mass Updates to update field values

To your frustration, when creating a new mass update, you may find that the field you want to update is not available on the ‘Mass Update’ screen.

By way of example, imagine you wanted to edit the ‘Approval Status’ of Vendor Bills to ‘Approved’ using a Mass Update. Unfortunately, you would be disappointed to find that the ‘Approval Status’ field is not available under the ‘Mass Update Fields’ subtab.

Fortunately, there is a solution using a ‘Mass Update’ script and a script parameter. Mass Updates provide a unique feature that allows the user executing the mass update to run a piece of code for each record that is returned by the mass update search criteria.

Note. This code must be written and deployed like any other NetSuite script, therefore an understanding of javascript and suitescript is required. The developer has access to all of the SuiteScript APIs so it is possible to do anything here from setting field values to sending emails and creating/deleting records.

The code provided below is taken from a Mass Update Script. This solution takes a user specified ‘Approval Status’ value set using a script parameter (more on that later) and uses it to populate the ‘Approval Status’ field of each record returned by the Mass Update Script.

function massUpdateApprovalStatus(rec_type, rec_id){

  var APPROVAL_STATUS_PARAM = nlapiGetContext().getSetting('SCRIPT','custscript_param_approval_status');

  nlapiLogExecution('AUDIT', 'VARIABLE_VALUE',"rec_type: "+rec_type);
  nlapiLogExecution('AUDIT', 'VARIABLE_VALUE',"rec_id: "+rec_id);

  var thisTransaction = nlapiLoadRecord(rec_type,rec_id);
  var thisTransactionStatus = thisTransaction.getFieldValue('approvalstatus');

  nlapiLogExecution('AUDIT', 'VARIABLE_VALUE',"thisTransactionStatus: "+thisTransactionStatus);

  if(thisTransactionStatus != APPROVAL_STATUS_APPROVED)
    nlapiLogExecution('AUDIT', 'CONDITION_ENTERED',"if(thisTransactionStatus != APPROVAL_STATUS_APPROVED)");
    thisTransaction.setFieldValue('approvalstatus', APPROVAL_STATUS_PARAM);

In the code snippet above, you will notice that the ‘APPROVAL_STATUS_PARAM’ value is read from a parameter, ‘custscript_param_approval_status'. This parameter is added to the Mass Update script as shown below.

This script parameter allows the user to select the ‘Approval Status’ they want to set on their Vendor Bills using a dropdown, and then update the Mass Update criteria to select the vendor bills whose Approval Status needs updated.

A final note when creating a Mass Update Script is deployment. Mass Update scripts must be deployed like any other script. It is the deployment that controls how the mass update is displayed on the ‘Mass Updates’ page.

As shown in the screenshot above, once the Mass Update script is deployed to Supplier Invoices it will be displayed under the ‘Custom Updates’ section of the ‘Mass Updates’ page.

Clicking on the name of your Mass Update script will direct you to the screen displayed below where you can populate the field (script parameter), ‘Approval Status’ created earlier and set your Mass Update search criteria.


As presented, Mass Update scripts can be a powerful tool for updating data in NetSuite allowing the creator access to the full suite of SuiteScript APIs along with the record type and id for each entry returned by the Mass Update saved search criteria. With Mass Updates, the opportunities are truly endless!


To stay in the loop for further news, guides, resources and more, sign up to "insight" our flagship weekly NetSuite and Business Software Newsletter, click here.