You need to sign in to do that
Don't have an account?

Creating an Email Alert off of an Error
I'm trying to create an email alert to be sent based on an error on an opportunity. I created a Unique Name field and workflow off of that which doesn't allow duplicate opportunities to be created. If a duplicate opportunity is created, once you try and save it, there is an error that appears saying that another record already exists (similar to the Duplicate Account rule). So now, I want to create an email alert that is triggered from this opportunity error but I'm not sure how.
Thanks!
Thanks!
This is Doable using before insert trigger and its associated helper class. I am assuming that on the basis of unique field on Opportunity you are deciding duplicate records. I am also assuming that you will send email to Associated Accounts Email address.
Please find below rough code for the same: Pease mark as best answer if helped.
Regards,
Ramakant
Okay great, yes the unique field was created to assist with finding duplicate opportunities. I actually want the email to go to the Manager of the person who attempted to create the duplicate record. We have a Manager field on the user screen that could be reference. Would this be possible?
Thanks!
Yes you can do this by using owner id of that Opportunity and then looking for users and their Managers email address.
Regards,
Ramakant