How to Lookup NetSuite Custom Record Script IDs

This article is relevant if you need to look up the custom records in your NetSuite account to learn the script identifiers.

Background

When creating SuiteScript, we often want to write our software in a manner that does not “hard code” references so that we have more freedom to distribute our work to new environments. Many of NetSuite’s SuiteScript functions require that you know the script ID of the target structure before you make the call.

But what if you don’t know the script ID of the custom record structure you are trying to target?

How To Lookup NetSuite Custom Record Script IDs

While not condoned as a regular practice, there are many undocumented features in the NetSuite development platform. It’s helpful to know some of these — yet we need to remember there is some risk that a discovered capacity can stop working at any moment.

Nonetheless, here is the SuiteScript pattern to search for the custom records defined in the NetSuite account and also learn each record’s script ID.

//SuiteScript 1.0
var columns = new Array();
columns[0] = new nlobjSearchColumn('name'); 
columns[1] = new nlobjSearchColumn('scriptid')
var s = nlapiSearchRecord('customrecordtype', null, null, columns)


//SuiteScript 2.0 
var s = search.create({
		type:    "customrecordtype",
		columns:  ["name","scriptid"]
	}).run().getRange(0,1000);

NetSuite Technical Leadership

If you found this article helpful, I am pleased. Our practice is to help our clients with all kinds of NetSuite innovations — thus we live in NetSuite SuiteScript every day and rely on our ability to deepen our knowledge and skills to be valued in the community. Perhaps you would like to be appreciated for your unique capacity to produce meaningful solutions in the NetSuite platform? If so, let’s have a conversation.

Be Sociable, Share!

Marty Zigman

Holding all three official certifications, Marty is Southern California's NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 25 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - Google Plus - YouTube

| Category: NetSuite, Technical | Leave a comment

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>