in a workflow I get the following error message: V...
# ask-stanley-ai
m
in a workflow I get the following error message: Value cannot be set in BEFORELOAD on already existing (not a new) record. any ideas?
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. ****** The error message you're encountering, "Value cannot be set in BEFORELOAD on already existing (not a new) record," is a limitation of NetSuite's workflow engine. In the
beforeLoad
event, you cannot set a value on a field for an existing record. This event is primarily used for adding fields or sublists to the form, or for setting field values on new records only. If you're trying to update a field value on an existing record, you should move your logic to the
beforeSubmit
event and set the field value on the
newRecord
object. Please note that the only time you can set a value in
beforeLoad
is if you're adding the field first, and that field would start with the internalid id of "custpage". If you're trying to set a field value based on a condition (like a saved search), you might need to consider a different approach, as this limitation seems to apply to all cases, not just when the record is being viewed. Unfortunately, there's no workaround for this limitation within workflows. You might need to consider using a SuiteScript if your use case requires setting field values on existing records during the
beforeLoad
event.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.883879125
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.881637216
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.876258075
Please provide your feedback on this answer.