This article is relevant if you are a NetSuite SuiteScript developer working client-side (browser) and wish to load and test modules directly from the browser console for faster debugging and exploration.
TL;DR Summary
With SuiteScript 2.x’s AMD module system, developers can use the require function in the browser console to access client-compatible modules such as N/currentRecord and N/record while working in edit mode on transaction records.
Background
Our Prolecto Resources Technology Practice thrives on extending and innovating within the NetSuite ecosystem. We are immersed in client-side and server-side development work every day. Wonderfully, this handy tip came from Thomas S., one of our newer team members who joined us through our Accounting Practice. While our Technology Practice has long understood how to work with this SuiteScript coding nuance, it reminded me that many in our NetSuite community benefit from these kinds of tips. In all respects, I appreciated the enthusiasm from a newer team member. It’s no surprise, as our firm fosters innovation from all corners, with each team member respected not only for their domain knowledge in Accounting or Operations, but also for their ability to contribute technically when faced with unique challenges.
NetSuite Client-Side Debugging with SuiteScript 2.x Modules
In SuiteScript 1.0, it was straightforward to experiment with API calls directly in the browser console. However, SuiteScript 2.x adopted the Asynchronous Module Definition (AMD) format to load modules. All the examples provided by NetSuite Help use the define statement. To make these work in the browser, they demand that we use require rather than define when loading modules interactively.
When working within a NetSuite record in edit mode (especially on transactions), the following examples demonstrate how to load modules and inspect data in the browser console.
Load the N/currentRecord Module
require(['N/currentRecord'], function (currentRecord) {
var rec = currentRecord.get();
console.log('entity:', rec.getValue({ fieldId: 'entity' }));
});
Or using the arrow function syntax:
require(['N/currentRecord'], (currentRecord) => {
var rec = currentRecord.get();
console.log('entity:', rec.getValue({ fieldId: 'entity' }));
});
Alternatively, the following syntax also works:
let currentRecord = require('N/currentRecord');
let rec = currentRecord.get();
console.log('entity:', rec.getValue({ fieldId: 'entity' }));
Load the N/record Module
require(['N/record'], function (record) {
var rec = record.load({
type: 'invoice',
id: 292160
});
console.log(rec.getValue({ fieldId: 'entity' }));
});
These examples only work with modules that are permitted on the client side. If the module you are trying to use is server-only, you will need to expose it via a SuiteLet or RESTlet to make it accessible in the browser.
Consider Other NetSuite Browser-Based Technical Tips
Over the years, I have written other articles that showcase how we can get to the browser console to work with NetSuite.
- 2015: Breakthrough: Improve NetSuite Line Visibility Beyond the “More…” Limiter
- 2016: How To: Quickly Update a NetSuite Read Only Field
- 2023: Update NetSuite Transaction Lines via the Browser Console
- 2025: NetSuite UI Hack: Select All Checkboxes with One Line of jQuery
Join a Team Driven to Innovate with NetSuite SuiteScript Development
This technical insight highlights how our Prolecto Resources professionals strive to share their knowledge and best practices, thereby enhancing our collective capabilities. Whether you’re a developer enhancing your SuiteScript capabilities or someone looking to elevate your NetSuite environment, we aim to model best-in-class execution while empowering those who work alongside us.
Our culture rewards curiosity and values contributors across business functions, designed to serve ambitious companies that look to unlock the latent value in the platform. We share our intellectual property and development patterns without a license fee through our Labs initiative. We believe in building trust by helping others develop better quality solutions, and we stand on the accomplishments of each client to deepen our expertise and delivery ethics.
If you found this article relevant, feel free to sign up for notifications to new articles as I post them. If you’re looking to join a high-caliber NetSuite development team, let’s have a conversation.

