David Captur
08/23/2024, 1:33 PMCeligo AI
08/23/2024, 1:33 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that NetSuite Saved Searches do not have a built-in feature to only send an email when the record count exceeds a certain number. However, you can potentially achieve this by using a combination of SuiteScript and Scheduled Scripts. Here's a high-level approach: 1. Create a SuiteScript that runs your saved search and gets the count of the results. 2. If the count exceeds 500, the script should send an email to you with the results. 3. Schedule this script to run at your desired intervals (e.g., every day at 5am). Here's a pseudo-code example of what the SuiteScript might look like:
javascript
var search = nlapiLoadSearch(null, 'customsearch_your_saved_search_id');
var resultSet = search.runSearch();
var count = resultSet.getResults(0, 1000).length; // adjust the range as needed
if (count > 500) {
// send email
nlapiSendEmail(
nlapiGetContext().getUser(), // sender
'<mailto:your@email.com|your@email.com>', // recipient
'Saved Search Results', // subject
'The saved search returned more than 500 results.' // body
);
}
Please replace 'customsearch_your_saved_search_id'
with the actual ID of your saved search, and '<mailto:your@email.com|your@email.com>'
with your actual email address.
Remember to schedule this script to run at your desired intervals using NetSuite's Scheduled Script feature.
******
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
08/23/2024, 1:33 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842216372
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841913104
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841866493
Celigo AI
08/23/2024, 1:33 PM