Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The NetSuite Pro

The NetSuite Pro Logo The NetSuite Pro Logo

The NetSuite Pro Navigation

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Home/ NetSuite SuiteScript Modules: Complete Guide to Every N/ Module/N/search Module in NetSuite: Complete Developer Guide

N/search Module in NetSuite: Complete Developer Guide

The N/search module lets you create and run on-demand searches or run existing saved searches from SuiteScript. It is one of the most used modules in NetSuite development and is far more governance-efficient than loading individual records in a loop.

Creating and Running a Search

define(['N/search'], (search) => {
    const mySearch = search.create({
        type: search.Type.CUSTOMER,
        filters: [
            ['isinactive', 'is', 'F']
        ],
        columns: [
            search.createColumn({ name: 'entityid', label: 'Name' }),
            search.createColumn({ name: 'email' }),
            search.createColumn({ name: 'phone' })
        ]
    });

    mySearch.run().each((result) => {
        const name = result.getValue({ name: 'entityid' });
        const email = result.getValue({ name: 'email' });
        log.debug(name, email);
        return true; // continue iterating
    });
    return {};
});

Loading a Saved Search

const savedSearch = search.load({ id: 'customsearch_my_search' });
savedSearch.run().each((result) => {
    log.debug('Result', result.id);
    return true;
});

Paginating Large Result Sets

For large result sets (over 4,000 results), use runPaged() instead of run() to process results in pages of up to 1,000 records at a time.

const pagedData = mySearch.runPaged({ pageSize: 1000 });
pagedData.pageRanges.forEach((pageRange) => {
    const page = pagedData.fetch({ index: pageRange.index });
    page.data.forEach((result) => {
        log.debug('ID', result.id);
    });
});

Common Filter Operators

OperatorDescription
isExact match
isnotNot equal
containsString contains
startswithString starts with
greaterthanGreater than (numeric/date)
lessthanLess than (numeric/date)
anyofMatches any of a list of values
noneofDoes not match any of a list
isemptyField is empty/null
isnotemptyField has a value

Key Methods Reference

MethodDescription
search.create(options)Create a new search object
search.load(options)Load an existing saved search
search.createFilter(options)Create a filter object
search.createColumn(options)Create a column object
searchObj.run()Run the search (max 4,000 results)
searchObj.runPaged(options)Run with pagination (up to 1,000/page)
searchObj.save()Save the search as a saved search
result.getValue(options)Get a column value from a result row
result.getText(options)Get the display text of a list/select field

← Back to All NetSuite Modules

Share
  • Facebook

Sidebar

Ask A Question

Stats

  • Questions 6
  • Answers 6
  • Best Answers 0
  • Users 5
  • Popular
  • Answers
  • Rocky

    Issue in running a client script in NetSuite SuiteScript 2.0 ...

    • 1 Answer
  • admin

    How can I send an email with an attachment in ...

    • 1 Answer
  • admin

    How do I avoid SSS_USAGE_LIMIT_EXCEEDED in a Map/Reduce script?

    • 1 Answer
  • admin
    admin added an answer The issue is usually caused by following Wrong script file… September 14, 2025 at 10:33 pm
  • admin
    admin added an answer Steps to send an Invoice PDF by email: define(['N/email', 'N/render',… August 28, 2025 at 3:05 am
  • admin
    admin added an answer This error means your script hit NetSuite’s governance usage limit… August 28, 2025 at 3:02 am

Top Members

Rocky

Rocky

  • 1 Question
  • 22 Points
Begginer
Sophie1022

Sophie1022

  • 0 Questions
  • 20 Points
Begginer
jmargoli

jmargoli

  • 0 Questions
  • 20 Points
Begginer

Trending Tags

clientscript netsuite scripting suitescript
  • NetSuite Customization Best Practices: Building Scalable and Maintainable SolutionsMay 26, 2026
  • NetSuite Next: The Future of AI-Enabled ERPMay 25, 2026
  • SuiteScript Code Assist: A Developer’s New Best FriendMay 24, 2026
  • NetSuite Planning Copilot: Scenario Forecasting Made EasyMay 23, 2026
  • AI-Powered Close Management in NetSuite 2026May 22, 2026
  • Advanced PDF Templates in NetSuite: Performance Optimization and Best PracticesMay 22, 2026
  • N/search vs N/query in SuiteScript 2.1 β€” When to Use WhichMay 22, 2026
  • Building NetSuite RESTlets with AI Integrations in 2026May 22, 2026
  • Advanced PDF Templates in NetSuite: Localization and Multi-Language DocumentsMay 20, 2026
  • Advanced PDF Templates in NetSuite: Integrating Saved Searches for Report-Style DocumentsMay 20, 2026

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Menu

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us

Quick Links

  • NetSuite Scripting
  • NetSuite Customization
  • NetSuite Advanced PDF Template
  • NetSuite Integration
  • NetSuite Reporting & Analytics

Subscribe for NetSuite Insights....

Β© 2026 The NetSuite Pro. All Rights Reserved