Chidi Okwudire IT Professional. ERP Enthusiast. NetSuite Certified (Administrator, SuiteCloud Developer II, and ERP Consultant). Celigo Certified (Level 4+). Passionate About Empowerment Through Knowledge Sharing. Always Eager to Learn.

How to Navigate Missing Field IDs When Using N/config

1 min read

Last updated on March 6, 2024.

Context

N/config is the SuiteScript module for accessing NetSuite configuration settings, for example, general preferences, user preferences, company information, company preferences, enabled features, and accounting preferences, among others.

The pattern is simple: You load the target configuration (config.load()) which returns a NetSuite record on which you can get or set values.

const configRec = config.load({
  type: config.Type.ACCOUNTING_PREFERENCES
});

const val = configRec.getValue(fieldId);

Challenge

To get or set a configuration value, you need the field’s ID. Recently, I needed to retrieve the Accounting Preference “Allow Inventory Transactions Dated Outside The Posting Period”:

Accounting preferences showing value missing in N/Config list of preference IDs

I looked it up on the page that lists the internal IDs for various preferences but it is not listed there. Then, I started off a complex, unnecessary path (which you should not after reading this article). I figured I’d load the config object as illustrated above, get the fields via configRec.getFields(), log them to the console and try to figure out which one matches my setting. While that could technically work, it will take time and require trial and error as the field IDs are not always fully aligned with the screen names.

Well, do NOT waste your time doing that because there is an easier way.


Solution

The config object is a special record. Nevertheless, when it comes to field IDs, it behaves no differently than native or custom records. Simply click on the field label to expose the help text which contains the field ID:

How to easily find the field Ids of NetSuite preferences.

The field ID of a NetSuite preference is the internal of the field which is accessible via the UI.

If the field ID is not visible, you probably have not enabled the user preference to “Show Internal IDs” as explained here.


This is one of those cases where, although I was reading the documentation (which is the right thing to do when working with unfamiliar APIs), I was misled by the “Preference Names and IDs” page which turned out to be incomplete. I’m glad that I got back on track fairly fast.

Keep this tip in mind for the next time you have to use the N/config module. And, share it with a developer in your circles.

NetSuite Insights is on a mission to raise the standards around NetSuite practices, one insight at a time. If that resonates with you, learn how you can become an author/collaborator here.

Don’t miss a beat – subscribe to our no-nonsense email list to have these game-changing insights hit your inbox as soon as they’re published. Ignorance? Nah, you’ve got a smarter option. Choose wisdom, choose insights!

Related Posts

Chidi Okwudire IT Professional. ERP Enthusiast. NetSuite Certified (Administrator, SuiteCloud Developer II, and ERP Consultant). Celigo Certified (Level 4+). Passionate About Empowerment Through Knowledge Sharing. Always Eager to Learn.

Leave a Reply

Your email address will not be published. Required fields are marked *

×