tiger
05/02/2025, 8:14 AMCeligo AI
05/02/2025, 8:15 AMAI generated answer (using internal Slack threads):When a Suitelet script tries to modify a record during the beforeSubmit event execution, it can potentially cause conflicts if there are other scripts (like User Event scripts) that are also trying to modify the same record. This is because multiple scripts trying to modify the same record can lead to race conditions, where the outcome depends on the sequence or timing of the scripts' execution. One way to handle this is to use a queue manager. This can be a custom record where you build the queue, and then scheduled scripts run against it to process records. This way, you can log if a record has errors and keep retrying automatically until it is successful. This approach can help to ensure that scripts do not interfere with each other and can execute successfully. Another approach is to use a Suitelet as a middle-man. The initial script sends a request to the Suitelet, which performs the save, and that save then triggers the
afterSubmit
on your custom record. However, this approach can be risky if you are using IP filtering on your account, as calling a Suitelet from server-side scripts can result in issues.
Alternatively, you could extract the logic out of the Custom Record's User Event and into a custom module, then leverage that module in both User Events. This can help to avoid conflicts and ensure that the scripts execute successfully.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/02/2025, 8:15 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843729734
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841751
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836257577
Celigo AI
05/02/2025, 8:15 AM