can externalid be set in beforeSubmit ?
# ask-stanley-ai
u
can externalid be set in beforeSubmit ?
c
AI generated answer (using internal Slack threads):
Based on the conversations provided, it appears that the
externalid
cannot be set in the
beforeSubmit
event of a User Event Script in SuiteScript. This is confirmed by multiple users in the threads. One user mentioned that the
externalid
can be set during the creation of a record if you're using
record.create()
in SuiteScript, but if you're creating a record through the UI and trying to set the
externalid
on the
beforeSubmit()
of that record, it will not work. Another user provided a code snippet showing how to set the
externalid
using the
record.load()
and
record.save()
methods, but this is not in the context of a
beforeSubmit
event:
Copy code
javascript
require(['N/record'], function (record) {
  const instance = record.load({ type: 'assemblyitem', id: 201369 })
  instance.setValue({ fieldId: 'externalid', value: 'works' });
  instance.save()
})
****** 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.851135314
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841430545
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83367908
Please provide your feedback on this answer.