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
West415West415 

Execute a Trigger after an approval Process?

Hi,

I have an approval process setup and wanted to know can I execute a trigger or apex code after a record has been approved?

Thanks...
Sonam_SFDCSonam_SFDC
I think you can use the ProcessInstance Object in the trigger to find out the status of any active approval process  - Confirm if the status is approved so you can perform any action in the trigger.

https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstance.htm
MissedCallMissedCall
Hi there,

You can also add a field update (checkbox flag) when a record is approved and based on the field update you could fire trigger.

Good Luck!
SFDC_DevloperSFDC_Devloper
Hi,

  I hope below link help you!

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


If this solves your problem, kindly mark it as the best answer.

Thanks,
Rockzz
West415West415
Good idea Senthil! I will try that as it seems clean and straightforward.