You can extract the type directly from the search, for example:
var searchresults = nlapiSearchRecord('item', search_id, null,
[
new nlobjSearchColumn('internalid'),
new nlobjSearchColumn('type'),
]
);
To get the same type of element from an element record directly:
var itemtype = record.getFieldValue('baserecordtype');
Alternatively, you can use, depending on your purpose:
var otheritemtype = record.getFieldValue('itemtype');
source
share