Why would a Map/Reduce script that's creating a sa...
# ask-stanley-ai
l
Why would a Map/Reduce script that's creating a sales order throw the following error:
"Invalid employee reference key -4."
c
AI generated answer (using internal Slack threads):
The error
"Invalid employee reference key -4."
is likely due to a similar issue as the one discussed in the third thread. In NetSuite, when a record triggers a native process that creates another record, that second record is created by -4 (System). However, if there is a workflow or script trying to set a custom field to the 'created by' value (user), it will not be able to set the field value to -4. In the context of your Map/Reduce script creating a sales order, it's possible that there's a field in the sales order that's trying to reference the 'created by' value, and it's encountering the -4 value, which it can't handle. To resolve this, you would need to add a condition in your script or workflow to skip the -4 value when setting the 'created by' field. This should prevent the error from occurring. ****** 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.846262276
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837467432
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835797966
Please provide your feedback on this answer.
Thank you for your feedback