From Clutter to Clarity: How to Mass Delete Records in Netsuite

Jona Obrador • September 11, 2024

How to Mass Delete Records in NetSuite

When dealing with high-volume data accounts, regular data cleanup becomes essential. Whether you're cleaning up your development account after performance testing or consolidating data from multiple instances during a company merger or acquisition, knowing how to mass delete records in NetSuite is invaluable. However, it's important to note that the methods outlined here are effective only for records that do not have dependencies. For example, if a sales order has related transactions such as invoices, you'll need to delete these related invoices first before you can remove the sales order. Ensure that all dependent records are removed before proceeding with the mass deletion to avoid errors.

1. Using the Record List UI


Yes! You can mass delete via the user interface, but there are a few prerequisites to meet first.


Prerequisites



  1. Set up the record for inline editing.
  2. Ensure there is a field that can be inline edited, such as the name field. Inline editable fields are represented by a pencil icon when viewing the list of records.
A form with text fields, checkboxes, and a highlighted

Enable inline editing.

Perform Mass Deletion

Once the prerequisites are satisfied, follow these steps:

  1. Navigate to the records list.
  2. Enable inline editing by toggling the “Edit” option beside the “Show Inactives” checkbox.
  3. Click on the editable field of the record to be deleted.
  4. Hold Shift and click on the last record on the list.
  5. Press Delete; a confirmation dialog appears.
  6. Click OK.


A table displaying a list of items with associated actions in a web interface.

Highlight the records for deletion.

Here's a video demonstrating these steps: Mass-Deleting-Records-via-UI


2. Using Mass Update Script

Preqrequisites

  1. Create a mass update script that deletes the records.

/**

 * @NApiVersion 2.1

 * @NScriptType MassUpdateScript

 * @NModuleScope SameAccount

 */


import {EntryPoints} from "N/types";


import * as record from "N/record";


export const each: EntryPoints.MassUpdate.each = (({type, id}) => {

  record.delete({

    type,

    id

  });

});

2. Deploy the script on the records to be deleted.

A web page titled

Execute Mass Update Script

  1. Create a Mass Update
  • Navigate to Lists > Mass Update > Mass Updates
  • The created mass update script deployment will be available under Custom Updates.
  • Click on the created mass update script deployment
  • Click “Save”
Interface for updating patient information. Shows buttons, fields, and a grid with data.

   

    2. Perform Mass Update

  • Navigate to Lists > Mass Update > Saved Mass Updates
  • Click “Preview” of the created Mass Update
  • Click "Perform Update".


Record results for deletion.


3. Using Workflow Action Script

Prerequisites

  1. Create a workflow action script that deletes the records.

/**

 * @NApiVersion 2.1

 * @NScriptType WorkflowActionScript

 * @NModuleScope SameAccount

 */


import {EntryPoints} from "N/types";


import * as record from "N/record";


export const onAction: EntryPoints.WorkflowAction.onAction = (({newRecord}) => {

    const {type, id} = newRecord;

    record.delete({

        type,

        id

    });

});

 2. Deploy the script on the records to be deleted.

3. Create a saved search for the records to be deleted (ensure there is at least one criteria).

Execute Workflow Action Script

1.Create a Workflow

  • Navigate to Customization > Workflow > Workflows > New.
  • Set Record Type to the record you want to delete.
  • Set Initiation to Scheduled.
  • Choose the saved search you created under Saved Search Filter.
  • Uncheck "repeat" to prevent re-execution.

2. Create a Workflow Action in Statesome text

  • Select the state and click “New Action”.
  • Create a state action using the deployed workflow action script.
  1. Execute Workflow
  • Navigate back to Workflow
  • Schedule or execute it immediately. To execute immediately, ensure Release Status is “Testing” and click “Execute Now”.

4. Using Map/Reduce Script

Prerequisites

1. Create a Map/Reduce script that deletes the records.


/**

 * @NApiVersion 2.1

 * @NScriptType MapReduceScript

 * @NModuleScope SameAccount

 */


import {EntryPoints} from "N/types" ;


import * as record from "N/record" ;

import * as runtime from "N/runtime" ;

import * as search from "N/search" ;


export const getInputData: EntryPoints.MapReduce.getInputData = () => {

  const currentScript = runtime.getCurrentScript();


  const RECORDS_TO_DELETE_SEARCH = "custscript_asp_records_to_delete" ;

  const savedSearchId = currentScript.getParameter({

  name: RECORDS_TO_DELETE_SEARCH

  }) as string;

 

  return search.load({

  id: savedSearchId

  });

};


export const map: EntryPoints.MapReduce.map = ( scriptContext ) => {

  const {key: id, value} = scriptContext;

  const type = JSON .parse(value).recordType;


  record.delete({

  type,

  id

  });

};

2. Include a parameter “Records to Delete Search” in the script record to allow dynamic input on which records to delete.

3. Create a saved search for the records to be deleted.

Execute Map/Reduce Script

1. Deploy the created script

2. Set the saved search you created in the “Records to Delete Search” parameter.

3. Schedule or execute it immediately. To execute immediately, ensure Status is “Not Scheduled” and click “Save & Execute”.


Final Thoughts

The best method depends on your needs. If you need to quickly delete a few records, the record list UI is your go-to. For handling large volumes of data with more flexibility, consider mass updates, workflow actions, or Map/Reduce scripts.


To see the complete SuiteScript code and implementation details discussed in this article, visit Jona's GitHub repository.


Jona Obrador Senior Netsuite Developer

Meet the Author

Jona has over a decade of experience in SuiteCloud Development on the NetSuite platform. She specializes in implementing advanced solutions and has led teams in creating high-quality software. Jona holds multiple certifications and has been recognized with awards like the Summit Award and Quality Champion Award.


Tags

Accelerate ERP Success with Expert Solutions

Ready to put what you've learned into practice? ATSOURCE delivers both the specialized talent and comprehensive NetSuite support you need to turn strategy into results.‍Connect with our experts today and move from planning to performance.

Silent killer of a developer's produtivity
By Jona Obrador October 1, 2025
Discover how excessive meetings disrupt developer focus and flow, and learn strategies to protect deep work for higher productivity and satisfaction.
The Quality Time &Resources Triangle in Software Development
By Jona Obrador September 23, 2025
Master the quality-time-resources triangle in software development. Learn strategic trade-offs to balance project constraints and deliver results.
Why Code Review matters
By Jona Obrador September 16, 2025
Transform code reviews from judgment to growth opportunities. Learn how to build positive review culture that improves code quality & team collaboration.