Nada Ahmed
07/02/2026, 2:51 PMCeligo AI
07/02/2026, 2:51 PMAI generated answer (using internal Slack threads):To track changes in the
externalId of old records, you would need to create a script that logs the changes. This script would need to be triggered whenever a record is updated.
Here's a basic example of how you could do this:
javascript
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
define(['N/record', 'N/log'], function(record, log) {
function afterSubmit(context) {
var newRecord = context.newRecord;
var oldRecord = context.oldRecord;
var newExternalId = newRecord.getValue('externalid');
var oldExternalId = oldRecord.getValue('externalid');
if (newExternalId !== oldExternalId) {
log.audit({
title: 'External ID changed',
details: 'Record ' + newRecord.id + ' had its external ID changed from ' + oldExternalId + ' to ' + newExternalId
});
}
}
return {
afterSubmit: afterSubmit
};
});
This script logs an audit entry whenever the externalId of a record changes. You can then review these logs to track the changes.
Please note that you can change the externalId of a record via script or REST API. However, you cannot unset the externalId once it has been set. You can only change it to a different value.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
07/02/2026, 2:52 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821960568
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812194824
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.810485899
Celigo AI
07/02/2026, 2:52 PM