Find your content:

Search form

You are here

Trigger to create task/email when Opportunity is updated with a certain stage

 
Share

I am trying to create a trigger (possibly After Update) such that it is fired when an Opportunity is updated with a certain stage. It should create a task and send an email to a user. The email should have a link to the Opportunity. Can this be achieved?

Also I would also like to know if Triggers are the only way to do this? Is there an out of the box configurable way to do this?


Attribution to: Richard N

Possible Suggestion/Solution #1

You can indeed achieve this with an Apex Trigger, however there is also an out of the box or declarative in Force.com speak way to do this. The standard Workflow functionality under Setup > App Setup > Create is where to look for this...

Workflow Task

This is the basic setup to get an email as shown below...

Workflow email

Workflow task

Final Image


Attribution to: Andrew Fawcett

Possible Suggestion/Solution #2

Create a standard workflow rule and create a Task whenever the oppurtunity reaches certain stage .Also to achieve the functionality where you wanted to give a user a link customize the email template ,You can use href along with anchor Tag in html email template to provide the link.


Attribution to: Mohith Shrivastava
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4273

My Block Status

My Block Content