• Kiranmai Yadagiri
  • 0 Points
  • Member since 2022

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1

I've created a checkbox for the User page layout to send out a custom new user email.  The goal is to send out the email when the checkbox is true, deploy the email, and then uncheck the box.  I've got everything working in before update, but I cannot get it working for insert.  I need to use After Insert to deploy the email because the email template I created in the apex class needs to be passed user field info (pass the User Id, name, email, etc).  If I uncheck the box in the before insert, then the criteria to fire the after insert will no longer exist.  I even tried making the method that unchecks the box @future, but that didn't work.  I would prefer to create another component like a workflow that would fire after the triggers due to SFDC order of execution.  Want a clean all apex solution for this.


This seems like a simple process, but I'm stuck at the moment.  Any help would be greatly appreciated.