update an external ID without doing a csv
# ask-stanley-ai
s
update an external ID without doing a csv
c
AI 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. ****** To update an external ID in NetSuite without using a CSV, you can use SuiteScript. However, please note that it's not possible to blank out an external ID once it's set. Your only option is to set it to a random value. Here's a general idea of how you can do it: 1. Load the record using
record.load
method. 2. Set the new value for the external ID using
record.setValue
. 3. Save the record using
record.save
. Here's a sample code snippet:
Copy code
javascript
var record = require('N/record');

var myRecord = record.load({
    type: record.Type.CUSTOMER, 
    id: 'internalId'
});

myRecord.setValue({
    fieldId: 'externalid',
    value: 'newExternalId'
});

myRecord.save();
Please replace
'internalId'
and
'newExternalId'
with your actual internal ID and new external ID respectively. Remember, this is just a basic example. Depending on your specific use case, you might need to add error handling, logging, or other functionality.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825255
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820259869
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817090452
Please provide your feedback on this answer.