I have a saved search set to send emails when a sa...
# ask-stanley-ai
a
I have a saved search set to send emails when a sales order is updated. The problem is that it's sending multiple emails about the same line-level field change on the same line, a few seconds apart. We only need to see it once per change per line. Why is it doing that, and how do I fix it?
c
AI generated answer (using internal Slack threads):
The issue you're experiencing with multiple emails being sent for the same line-level field change on a sales order could be due to the way NetSuite processes system notes. When a line-level field is updated, NetSuite may create multiple system notes for the same change, which could trigger your saved search multiple times. To fix this, you could modify your saved search to only trigger on specific system note types, or add a condition to check if the same email has already been sent for the same change. This could be done by adding a custom field to the sales order line to store the last change that triggered an email, and then checking this field before sending an email. Here's a rough example of how you could modify your saved search: 1. Add a custom field to the sales order line to store the last change that triggered an email. Let's call this field
custbody_last_email_trigger
. 2. Modify your saved search to include a condition that checks if the system note field is different from
custbody_last_email_trigger
. 3. In the email section of the saved search, add a formula that sets
custbody_last_email_trigger
to the value of the system note field. This way, an email will only be sent if the system note field is different from the last change that triggered an email. Please note that this is a general approach and may need to be adjusted based on your specific use case and NetSuite setup. ****** 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.846002877
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839213789
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838397503
Please provide your feedback on this answer.