Is there a way to send an email alert from a saved...
# suitescript
g
Is there a way to send an email alert from a saved search for a transaction that is in a certain status for more than a certain time frame? I'm assuming the transaction would need to have an update of some sort at that certain time for it to then trigger and send email alerts when records are created/updated however want to avoid using a scheduled workflow or a script if possible...
n
You are correct, you would need some sort of system event to happen in order to trigger. I don't think it would be possible without scripting or workflow
a
I think you might be able to do it if you join to the system notes table and have a timestamp filter from there on your saved search? 🤔 I'm not 100% certain, but that seems like it could be viable
n
The problem is you need a way for the system to know its been a certain amount of time. Usually emails from saved searches happen whenever a field changes that meets a certain criteria to trigger the email. If there is nothing changing on the record, Netsuite has no way of periodically checking how long its been unless you have a scheduled process running.
c
^^^ You would need something like custom fields to keep a timestamp of the start and end time of the state you want to track, then a script or workflow to populate those fields as the state changes.
g
thanks all... yeah thought so.. only way would be a WF or a script to put a timestamp on the order post a certain timeframe and then this would trigger the email via the SS...
a
to be clear I'm not recommending it as a solution, but couldn't you run the search on a schedule? and then have a dynamic filter based on a formula comparing current time to system note timestamp? This seems like it could be feasible? is it not? I guess you'd be limited by the schedules on saved searches which is only 1/day status = pending sysnote.field = status sysnote.newValue = pending formula (datetime) = case when {sysnote.date} + {myoffset} > {now}, 1 ELSE 0 END = 1
☝️ 1