I have a SuiteScript 2.0 restlet that calls record...
# ask-stanley-ai
b
I have a SuiteScript 2.0 restlet that calls record.delete() from N\Record. In some accounts, calling record.delete() with a nonexistant id will result in a RCRD_DSNT_EXIST error code, but in other accounts it results in UNEXPECTED_ERROR. Why would the result be different between accounts?
c
AI generated answer (using internal Slack threads):
The difference in error codes when calling
record.delete()
with a non-existent id in SuiteScript 2.0 could be due to a variety of factors. Here are a few possibilities: 1. Different NetSuite versions: Different accounts may be running different versions of NetSuite, which could potentially handle errors differently. 2. Customizations: If there are any custom scripts, workflows, or plugins installed on one account and not the other, they could be interfering with the delete operation and causing the UNEXPECTED_ERROR. 3. Permissions: The role used to execute the script might have different permissions in different accounts. If the role doesn't have delete permissions on the record type in question, it could result in an UNEXPECTED_ERROR. 4. Data differences: If the data in the two accounts is different, it could be causing the discrepancy. For example, if there are dependencies or relationships between records in one account that don't exist in the other, it could affect the outcome of the delete operation. 5. SuiteScript API differences: There might be differences in the SuiteScript APIs used in different accounts. If one account is using a newer or older version of the API, it could handle errors differently. Remember to always test your scripts thoroughly in a sandbox environment before deploying them to production, and to handle errors gracefully in your code to prevent unexpected behavior. ****** 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.835937679
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832824767
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831787229
Please provide your feedback on this answer.