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
SRILAKSHMI BSRILAKSHMI B 

Is it Possible to display Custom VF page upon Clicking Approve/Reject Link.

Hi All,

Please let me know is it possible to display the custom visualforce page upon clicking the Approve/Reject Link on the record instead of  displaying standrad Salesforce Approve  page.

 

If it is  possible then please let me know how that could be acheived.

 

Thanks,

Srilakshmi B

 

GuyClairboisGuyClairbois

The Approve/Reject Button is not available for overriding, the buttons which can be overridden are listed in the "Setup" section of that object under "Buttons and Links". The other way of implementing it is to use visual force to write custom code mimicking the "Approval Process" functionality.

SRILAKSHMI BSRILAKSHMI B

Hi,

 

Thanks for your reply.I have developed the visual force page with custom Approve/Reject buttons.Since I am using custom functionaliy for approval process how can  I display the Approval History for this.Because If I add Approval histrory related list to the Page Layout then it will contain standard Submit for Approval Approve and Reject Button as well which will confuse the user.

 

Please let me know how can I show the Approval History in the record detail page without  using the standrad approval history relatedlist.

GuyClairboisGuyClairbois

Hi,

since you're in a VisualForce page anyway, you could just query the Approval History and put it in a apex:pageBlockTable. There are many examples of this in the VisualForce documentation.

 

Here's an example of the query you'd need to execute (you can't query the approval history directly)...

This example assumes you've got a custom object, Mileage, that has an approval process hooked up to it:

 

Select m.Name, m.Id, (Select Id, StepStatus, Comments, CreatedDate From ProcessSteps) From Mileage__c m

 

Hope this helps!

KalladathilKalladathil

Hi,

I have the similar requirement. Could you please share the code.

 

Thanks