List of Netsuite commands in browser console- to get the record type

There is a scripting way without using searches to get the record type of a NetSuite record, if you have the internal ID:

nlapiGetRecordType({internalid})

This can be run in the browser console on a NetSuite record page.

You can also get the internal ID of the current record using:

nlapiGetRecordId()

Putting them together, you can get the record type of any supported record in the browser of that record’s page:

nlapiGetRecordType(nlapiGetRecordId())

Anyone familiar with SuiteScript will have noticed the above are the version 1.0 APIs. In my opinion, these are the best for this usage as they are simple, one-line and quick, but for completeness here are the relevant 2.x APIs also.

To retrieve the internal ID in SS2.x you need to load the N/currentRecord module, get() the current record, and then the id is available as a property:

require(['N/currentRecord'], function(cr){
    console.log(cr.get().id);
});

To get the record type is very similar, as that is also available as a property once the current record object is loaded:

require(['N/currentRecord'], function(cr){
    console.log(cr.get().type);
});

All the provided examples should work in the browser console of a SuiteScript supported NetSuite record page.

Leave a comment

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