can I set external id through a user event script?
# ask-stanley-ai
t
can I set external id through a user event script?
c
AI generated answer (using internal Slack threads):
Yes, you can set the external ID through a User Event Script in NetSuite. However, it's important to note that you cannot set the external ID in the 'beforeSubmit' context of a User Event Script. You can only set it in the 'afterSubmit' context. Here is a sample code snippet that was shared in the conversations:
Copy code
javascript
newRecord.setValue({
    fieldId: 'externalid',
    value: '123',
    ignoreFieldChange: true
});
This code is meant to be used in the 'afterSubmit' context of a User Event Script. It sets the 'externalid' field of the record to '123'. The 'ignoreFieldChange' parameter is set to true to prevent triggering field change scripts. Please note that setting the external ID in the 'afterSubmit' context may have performance implications as it requires an additional write operation to the database. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861029625
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85739094
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856624782
Please provide your feedback on this answer.
t
I am not able to set it on a account record