You need to sign in to do that
Don't have an account?

Standard Approval process button in visualforce
Hi All ,
I have a requirement to use standard aproval process functionality in visualforce page . For that I used Standard controller and showed the detail page using apex:detail tag which shows the approval process button .
But when I click on the button , it is redirecting to detail record page , Instead I need it to remain in same visualforce page where the button is clicked and showing alert box saying record is sent for approval .
Please note that I dont want to use custom approval process with apex
Can anyone help me here?
Regards,
I have a requirement to use standard aproval process functionality in visualforce page . For that I used Standard controller and showed the detail page using apex:detail tag which shows the approval process button .
But when I click on the button , it is redirecting to detail record page , Instead I need it to remain in same visualforce page where the button is clicked and showing alert box saying record is sent for approval .
Please note that I dont want to use custom approval process with apex
Can anyone help me here?
Regards,
You can invoke the approval process from the Approval Class (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_approval.htm).
Here is the snippet for your reference:
VF Page:
Controller:
Please upvote and mark this answer as solved, if it helped you.
Cheers!
Ajinkya Deshmukh