Where can I find the documentation that tells us w...
# ask-stanley-ai
a
Where can I find the documentation that tells us which things execute first, if I have beforeload functions in User Event Scripts and beforeload actions in Workflows?
c
AI generated answer (using internal Slack threads):
The order of execution between User Event Scripts and Workflows in NetSuite is not explicitly documented. However, based on the shared experiences and knowledge of the community, User Event Scripts are generally executed before Workflows. This means that if you have a beforeLoad function in a User Event Script and a beforeLoad action in a Workflow, the User Event Script will execute first. For User Event Scripts, the order of execution can be controlled and viewed on the Scripted Records page. Scripts run linearly from top to bottom, and when you click edit, they can be rearranged. However, there is no similar functionality for controlling or viewing the order of execution for Workflows. Please note that the EntryPoint/Trigger will always take priority. For example, UserEvents BeforeSubmit will go before a workflows BeforeRecordSubmit but a workflows BeforeRecordLoad will fire before a UserEvents AfterSubmit. For more information, you can refer to the following resources: - [Which Executes First: User Event Scripts or SuiteFlow?](https://leacc.com.ph/2019/03/04/which-executes-first-user-event-scripts-or-suiteflow/) - [NetSuite Online Help](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1543854650.html) ****** 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.870483458
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865173399
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.864929199
Please provide your feedback on this answer.