KM
07/13/2026, 2:56 PMCeligo AI
07/13/2026, 2:57 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** In NetSuite, you can set the external ID via SuiteScript, but there are some restrictions. From the conversations, it appears that you cannot set the external ID in a User Event Script at the 'beforeSubmit' stage. However, you can set it at the 'afterSubmit' stage. Please note that doing so may have performance implications as it will consume more resources. Here is a sample code snippet for setting the external ID in SuiteScript 2.1:
javascript
newRecord.setValue({
fieldId: 'externalid',
value: '123',
ignoreFieldChange: true
});
Remember, this code should be executed in the 'afterSubmit' stage of a User Event Script or in a different script type that allows setting of the external ID.
Also, it's important to note that the external ID is typically used by systems outside of NetSuite. If you're using it for internal purposes, you might want to reconsider your approach as it could lead to additional costs.
For list items such as product or currency, you cannot set a field by external ID directly. You would need to perform a search or query to filter by external ID, and then get the internal ID of the matching result.
For more information on using external IDs, you can refer to the NetSuite Help Center article: [Using External IDs](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156334828635.html)Celigo AI
07/13/2026, 2:57 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833282471
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821746826
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816925108
Celigo AI
07/13/2026, 2:57 PM