User event script not firing when close button cli...
# ask-stanley-ai
p
User event script not firing when close button clicked on sales order
c
AI generated answer (using internal Slack threads):
Based on the conversations, it appears that the 'Close Order' button in NetSuite does not directly trigger a User Event. However, there are several workarounds suggested in the threads: 1. Custom Close Button: Create a custom 'Close Order' button that triggers a User Event. This can be a good solution if you need immediate action. 2. Before Load User Event: Use a 'Before Load' User Event script, which is triggered when the user views the sales order after closing it. However, this method does not have an oldRecord, so you can't differentiate between a Sales Order that was closed yesterday and the one you closed now. To overcome this, you could use a checkbox that you mark after your script runs on a closed order. 3. Session Management: Another suggestion was to use session management to store a value related to the closed status of the order. However, this solution was debated as sessions don't last forever and you would lose state after the session is lost. 4. Base_t Cookie: An extreme alternative is to rely on NetSuite adding the base_t cookie and check that the base_t cookie contains the URL path for closing sales orders. Your 'Before Load' User Event can use the base_t cookie instead of a custom field to determine that the close button was pressed. 5. Saved Searches and Scheduled Scripts: If you can cope with a short delay, you can build something with saved searches and scheduled scripts. 6. SuiteAnswer Id 41825: There is a SuiteAnswer that explains about this limitation and shows a workaround, which uses the Before Load event to read the transaction status. ****** 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.859741211
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85760504
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853027403
Please provide your feedback on this answer.