function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sanchivan SivadasanSanchivan Sivadasan 

How to send Notifications when Approval is reassigned?

Hi there,

 

Currently there is no actions in the Approval configuration that I can do to send an email alert when a user reassign the approval step to someone else.  Is there anyone who was able to archieve this by any other means? Thanks.

 

Sanch.

Sonam_SFDCSonam_SFDC

Hi Sanch,

 

Yes, this is something which is not possible through the standard Approval process but you can customize the process using the ProcessInstance class:

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstance.htm

 

The processInstanceStep contains the ActorID and OriginalActorID which you can compare and when this is changed by the user who owns the record - you can send an email alert using Apex. 

 

Read more:http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstancestep.htm

 

The code snippet to send email to user through apex is given on link below:

http://boards.developerforce.com/t5/Apex-Code-Development/Email-Trigger/m-p/715433#M133266

Sanchivan SivadasanSanchivan Sivadasan

I thought it's not possible to write a trigger on the ProcessInstance class. How would you go about doing that? Thanks.

Sonam_SFDCSonam_SFDC

You don't have to create a trigger on the ProcessInstance class : please check the link below to understand how you can work with apex and trigger to get a record to be submitted for approval and customize the steps involved in Approval process:

http://shivasoft.in/blog/salesforce/dynamic-approval-process-based-on-the-apex-and-trigger/