Skip to main content
Hello

 

We have an Apex trigger on the lead object that we are having problems with.  For one, this trigger was written prior to our going live company wide, and I am not sure if this thing was ever correct.

 

Can I get someone just to take a look at the code and let me know if we are completely off base?

 

Briefly, we want to send an email (once only) to a rep when the lead owner changes.  This seems to be simple enough, but we are beating our heads against the wall.  We also have assigment rules on this same object which changes the lead owner.

 

Seq:  Create lead, assignment rules immediately changes owner, then send email to this latest owner, only once.

 

I do know that triggers execute when something happens to the object, when it is new or changed, etc, but we need to do a couple of things in our case.  I'm just afraid our brains are still in our other systems, and not thinking as we should in SFDC.

 

I don't know how this support works, but I can send the code to you for review and feedback, that would be heaven!!

 

Thanks

 

PS  This is our first assignment in SFDC, our first foray outside the friendly confines of the tutorials, classes and webinars.
2 respuestas
  1. 23 nov 2019, 0:05
    Hi Suzi, Fantastic idea!

     

    There's no need to limit yourself to Salesforce, though. There are many, many great Apex developers out there who would be great resources. I've started doing some reviews of Salesforce sample code (http://force-code.com/high-quality-apex-code-review-2/) to demonstrate the process and hopefully get a conversation going around the importance of reviews and best practices in Apex coding. Take a look if you get a chance! Feel free to send me a message if you'd like help in reviewing code (steve@foce-code.com)
0/9000