You need to sign in to do that
Don't have an account?
Recondo
Trigger Notification for Deleted Records
Hi, I am working on setting up an email notification to be sent once an account record is deleted. I have looked into workflows but it would seem a trigger is a better avenue of approach. I am still learning how to write triggers so am not 100% sure how to leverage once a record is deleted. Any suggestions would be great. Thanks!
You are right that you need to use a trigger, as workflows cannot be triggered off of deleted records. Assuming you are looking to send an email containing the account name, each time an account is deleted, you could try something like this (untested):
All Answers
It would look something like this:
Testing this code should be easy: Create a new account, then delete it (just a couple lines of code).
You are right that you need to use a trigger, as workflows cannot be triggered off of deleted records. Assuming you are looking to send an email containing the account name, each time an account is deleted, you could try something like this (untested):
Thanks guys for your help! We are in business!
Recondo, just be aware the solution you marked will spam account owners up to 200 times more because it sends one message per record during mass deletions. Also, that solution will eat up your daily mass email limits.
Thanks for the heads up sdfcfox!
We should be good to go in our instance as we have locked down the account deletion process to only sys admin at this time. We have gone through quite a bit of cleanup and only delete an account ~1/week.
Thanks again!