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/record Module in NetSuite: Complete Developer Guide

N/record Module in NetSuite: Complete Developer Guide

The N/record module is the most fundamental module in SuiteScript 2.x. It provides full CRUD (Create, Read, Update, Delete) operations on any NetSuite record type β€” from Sales Orders and Customers to custom records. Every serious SuiteScript developer uses this module daily.

Loading the N/record Module

define(['N/record'], (record) => {
    // your code here
    return {};
});

Creating a Record

Use record.create() to instantiate a new record object in memory. Set its fields, then call save() to persist it to NetSuite.

const newRecord = record.create({
    type: record.Type.CUSTOMER,
    isDynamic: true
});
newRecord.setValue({ fieldId: 'companyname', value: 'Acme Corp' });
newRecord.setValue({ fieldId: 'subsidiary', value: 1 });
const customerId = newRecord.save();
log.debug('Created customer', customerId);

Loading an Existing Record

const soRecord = record.load({
    type: record.Type.SALES_ORDER,
    id: 12345,
    isDynamic: false
});
const status = soRecord.getValue({ fieldId: 'status' });
log.debug('SO Status', status);

Updating a Record with submitFields()

For updating just one or two fields, use record.submitFields() instead of loading the full record. This is far more governance-efficient.

record.submitFields({
    type: record.Type.CUSTOMER,
    id: 12345,
    values: { email: 'new@email.com', phone: '555-1234' }
});

Deleting a Record

record.delete({
    type: record.Type.CUSTOMER,
    id: 12345
});

Working with Sublists

Sublists (such as line items on a Sales Order) require their own set of methods. Use getLineCount(), getSublistValue(), setSublistValue(), and insertLine().

const lineCount = soRecord.getLineCount({ sublistId: 'item' });
for (let i = 0; i < lineCount; i++) {
    const item = soRecord.getSublistValue({ sublistId: 'item', fieldId: 'item', line: i });
    const qty = soRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: i });
    log.debug('Line ' + i, item + ' x ' + qty);
}

Key Methods Reference

MethodDescription
record.create(options)Create a new record in memory
record.load(options)Load an existing record by type and ID
record.copy(options)Copy an existing record
record.delete(options)Delete a record permanently
record.submitFields(options)Update specific fields without loading the full record
record.transform(options)Transform one record type to another (e.g., SO to Invoice)
recObj.getValue(options)Get a body field value
recObj.setValue(options)Set a body field value
recObj.getSublistValue(options)Get a sublist field value
recObj.setSublistValue(options)Set a sublist field value
recObj.getLineCount(options)Get the number of lines in a sublist
recObj.save(options)Save the record to NetSuite

Governance Cost

Loading a record costs 10 governance units. Saving a record costs 20 governance units. submitFields() costs just 10 units. Always prefer submitFields() when updating only a few fields, and use N/search to read field values in bulk rather than loading individual records.

← 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