Hi all, long shot but thought worth asking... I'm...
# suitescript
g
Hi all, long shot but thought worth asking... I'm trying to send an email based on the results of a saved search which is a formula field and want to email if the time on the report is greater than 30mins.. my results are 3 fields - system notes: date, formula text group and formula numeric with summary type minimum and formula to identify time between now minus system notes date - (TO_CHAR({today},'YYYY') * '525600' + TO_CHAR({today},'MM') * '43800' + TO_CHAR({today},'DD') * '1440' + TO_CHAR({today},'HH24') * '60' + TO_CHAR({today},'MI')) - (TO_CHAR({systemnotes.date},'YYYY') * '525600' + TO_CHAR({systemnotes.date},'MM') * '43800' + TO_CHAR({systemnotes.date},'DD') * '1440' + TO_CHAR({systemnotes.date},'HH24') * '60' + TO_CHAR({systemnotes.date},'MI')) Assume I need to create a scheduled script to send if the time is greater than 30 mins but not sure how to do this...ID of the saved search is 4409 and is called 'Order received Time'... is there anyone who could help out with this?
d
I would update your formula to be:
TRUNC(({now}-{systemnotes.date})*24*60)
which gives you the number of minutes since the system note date
IIRC, you could use either
{now}
or
{today}
in this instance
now, for your saved search results, you could run either a scheduled script or M/R script and run your search. For the search, either: 1. add a criteria for the 'minutes' formula being greater that 30 and send an email for every result. 2. run the search without this criteria and just check the result of this formula in the results to see if an email should be sent. method 1 should be faster, but if you need to do something with the <30 min results, you'd have to use method 2
g
thanks @David B, the formula is a much simpler one... Any idea how the script should be? also a bit of clarity on point 2 if possible pls...
d
You'll need to lookup script examples in suiteanswers/help center. option 2 is just running the search without criteria and doing all the logic "manually" with your script (as opposed to letting the search criteria filter the results for you)
Also, I'm not saying that scheduled script is the way to go, I know nothing about the requirements or use-case