August 9, 201510 yr Looking for some help in setting up an auto email to specific recipient when a field is modified. What I'm looking to accomplish is when Sales Rep = X, and any field is modified, send an email to X. Ideally it would also include what field was changed as part of the email content. Currently I have a single script setup (see attached) that when a rep logs in, it automatically goes to the Sales Rep Access layout, then if Sales Rep = X, it does an automatic find for their name in the Sales Rep field and only displays their accounts. Edited August 9, 201510 yr by HX_Guy
August 11, 201510 yr Currently I have a single script setup (see attached) that when a rep logs in, it automatically goes to the Sales Rep Access layout, then if Sales Rep = X, it does an automatic find for their name in the Sales Rep field and only displays their accounts. This can be done a lot easier and more correct by using the built in access privileges.
August 12, 201510 yr Since you are defining who "Sales Rep" is at the record level, couldn't you just have a relationship based on that field and match field in the Users table. With that I'm place, you could then get the email address via that relationship (theReationship::Email).The more interesting part to me is the record modification. When would you trigger the email to be sent? You need to think this through rather thoroughly or else you may be generating many emails.Hope this helps.
August 12, 201510 yr Author I was thinking probably on record save would be the best way to set it up because as you said, if its on every field that could get a little out of hand. I just have no idea how to set that up though. :/
August 13, 201510 yr Hi HX_Guy,Here is a little sample file I zapped up. It uses field mod tracking. It does the following:ON RECORD LOAD- stores a list of fields present on the layout in a global- stores the values of those fields in a globalON RECORD SAVE - stores the current value of the fieldsON LAYOUT- displays an EMAIL button if there has been a change- Record Navigation to trap against navigation to another record without sending emailAlso, included a REP table to store reps and their email addresses. Established a relationship based on the primary key of the REP. Pulling the name and email address via the relationship. See Send Mail script options.Tear it apart, learn from it, and adapt it to your solution if it fits.Good luck! mod_alert_email.zip
August 13, 201510 yr Author Havne't had a chance to even open the app but wanted to thank you for taking the time to put that together and help out.
Create an account or sign in to comment