1



I have been working on our Opportunity page to add a custom checkbox if the opportunity is conditionally approved. What I would hopefully like to do to sew this up would be to use a trigger to send an email to the opportunity owner saying to resolve questions before full approval.

The trigger should send the email after the page is saved with the conditional approval checkbox checked. I have it to where the trigger does send an email, but I had to send it to my email for testing. What I'm hoping to find is how to get the owners email address and the ID number for the url link in the email.

I have done a lot of searching and there are a lot of things out there, but nothing that I see that focuses on what I need. Can anyone help with code examples or direct me where to look? I'm still pretty new at SalesForce and Java, so hopefully it won't be too in depth. Like I mentioned, the trigger does send out email when the page is saved correctly, I just need to see if I can get the owners address and page ID (15 chars?) for the link.

Thank you again for any help you can be!!!

Kurt

  • 3
    Why don't you use Workflow instead of a Trigger? You could probably get the info you need using formula fields. – Phil Hawthorn Jun 12 '13 at 17:19
1

Make a new Email Template (type it into search in setup), start with type = text.

Subject could be: you have to fix {!Opportunity.Name} Body:

Opportunity {!Opportunity.Name} needs your attention (conditional approval). Please log in and fix it!

{!Opportunity.Link}
{!Opportunity.Id}

You can also verify whether the email will look the way you think it should:

enter image description here

You'll be able to use such templates in workflow. Roughly speaking workflow consists of triggering condition and action (there can be multiple actions: field updates, email messages etc). (Once you've set up the workflow remember to click "Activate", common rookie mistake).

Just read up a bit about them in Setup / Help and come back (edit this question) if you need more help?

  • I was really barking up the wrong tree!! That made a big difference. And @eyescream thank you for the visual guidance, it was a great help. It These little tricks saved me a lot of time and coding. And yeh...I'm a newbie. Even after reading you mentioning to "Activate" it, I still forgot!! Thanks again folks....I really appreciate your time and help!! – Kurt Jun 12 '13 at 19:50
  • Also a big thanks to you too @Phil Hawthorn, that got me pointed in the right direction and away from trying to figure out the triggers!! – Kurt Jun 12 '13 at 19:51
  • Luckily that was one part of SF that's easy to modify with "clicks, not code" :D Hopefully it'll be all smooth ride for you from now on! – eyescream Jun 12 '13 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.