You need to sign in to do that
Don't have an account?
RadDude89
Apex trigger to start standard approval process
Hi,
We have set up an approval process called Renew. This approval process was created via the standard process (adding email alerts, approval/rejection field updates, etc). When we create an offer record the approval process doesn't start - the user must press submit for approval. Can you create an apex trigger to initiate an approval process when a record has been created?
So in a way we would be pressing the submit for approval for the user automatically.
Can the trigger call on the ID of the approval process to initiate it if certain requirements are met?
You can try below sample code for your requirement.
Apex Trigger:
Let me know if you have any question on this. Please mark this "Solved" if it helps.
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/
All Answers
http://releasenotes.docs.salesforce.com/en-us/spring15/release-notes/rn_forcecom_process_visually_automate.htm#rn_forcecom_visually_automate
Still if you want to do it with a trigger, you get the sample code with test class from below link:
http://blog.jeffdouglas.com/2010/01/04/automating-salesforce-approval-processes-with-apex-triggers/
You can try below sample code for your requirement.
Apex Trigger:
Let me know if you have any question on this. Please mark this "Solved" if it helps.
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/