Loading a NetSuite Item Record From Just The Item ID

in , , January 26th, 2024

Problem: Missing NetSuite Item Type

Want to load a NetSuite item record but only have the item ID? You may think you can’t load the record because you need to know whether it's an inventory item, a discount item, a lot-numbered assembly item, etc.

However, if you have the item ID but no item type, it is still possible to load the NetSuite item record! You can do this by getting the item type from the ID.

Solution: Use Type 'item' with Internal ID

To get the record type from the record ID, we run a search that allows us to use just the type 'item' and the internal ID. example:

var itemId = 12345;
return record.load({
type: search.lookupFields({type: 'item', id: itemId, columns: 'recordtype'})['recordtype'],
id: itemId
});

That's how to get the record type using the record ID! It's a very simple, but helpful solution for cases when you are missing the NetSuite item type.

Author: JP Terneus


Get stuck in a step during this article?

We like to update our blogs and articles to make sure they help resolve any troubleshooting difficulties you are having. Sometimes, there is a related feature to enable or a field to fill out that we miss during the instructions. If this article didn't resolve the issue, please use the chat and let us know so that we can update this article!

 
 

Want to keep learning?

Our team of NetSuite professionals has written articles on a wide variety of NetSuite topics, from SuiteCommerce tips, to recommended NetSuite solutions, to available support services, and more! 

Your cart