Any way (via script or wf) to trigger something wh...
# general
j
Any way (via script or wf) to trigger something whenever an email is sent to a record? like if a customer replies back to an email sent from a sales order or something?
I’m trying to find a way to sent Out of Office replies automatically when someone emails back to one of the NetSuite reply-to emails.
b
I believe that scripting should be able to handle this. In past work experiences, I've had a similar set up for when users reply to the Netsuite emails
j
I’m at a total loss for knowing how to detect incoming emails
b
first step is to determine if user event scripts are suitable
deploy a user event script that implements all entry points that simply logs that it was triggered
then deploy it to all records
then reply to the email sent from the record
wait for the message to appear on the record, and then check the logs
if your email triggered a log, you can use a user event script
if not, then you need to rely on a search/query to find your message
usually in a map/reduce or scheduled script
j
yeah I was thinking Scheduled Script might be the approach. Basically set it to run every <x> minutes, and check the previous <x> minutes for received emails where the intended recipient was someone currently out of office.
b
your account has a very nice queue if you think you can rely on it running every x minutes
j
hahhah
well we don’t have too many scheduled scripts
we have a similar one that runs every … 4 hours maybe? that checks for emails that we sent that ended up undelivered. Because NetSuite doesn’t bother to TELL you when this happens.
@battk looks like replying to NS record doesn’t trigger UE at all. Sad.
b
the usual is to make sure that you properly deployed the script
and in this case, wait for netsuite to receive the email
j
I did test that
replied back to a support case
even though the system notes of case show that the
Last Message Date
changed, the UE on the Case didn’t trigger at all.
b
apply to all records
j
I think I can deploy to
Message
oooh I think this will work
now I need to figure out the best way to determine when someone is “back” from being away, given the weird way NS models vacations in the calendar.