You need to sign in to do that
Don't have an account?
JRTConsult
How to Display "Approval History" as the only Related List on a Visualforce Page
I have build a "read-only" version the data from a custom object using visualforce. I can layout all the fields on the page, but I don't know how to add just the "Approval History" related list section to the page. It seems like there should be some simple syntax to show or hid related list sections associated with that object.
Thank you in advance for your response.
All Answers
Note: Name of the list should be available in the setup page for your custom object.
You can find the full documentation for that tag in the appendix of:
http://www.salesforce.com/us/developer/docs/pages/index.htm
Hope that's what you were looking to do.
Hi Yori/Jim,
I have created a Custom VF Screen with a Custom Controller.
The issue is that i am unable to show the Approval History related list on the Custom Screen, even though i am using the below code:
<apex:relatedList list="ProcessSteps" ></apex:relatedList>
Is there something missing out here? Did the same thing work for you guys? I have created an Approval Process on the custom object also.
Thanks a ton Jim for the help extended.
Can you please elaborate or direct me to some reference about "Controller Extension". I am not too sure of how that works :(
Also, my page is totally a custom developed VF page so i need to use the Custom Controller for the requisite functionality. I hope this concept works in this scenario.
Really appreciate your help Jim!!
Many Thanks
You probably have your page set up like this (plus whatever other elements you are adding:
Hello Jim,
I must say you saved my life :)
Many thanks for the elaborate post as i was able to use this concept to achieve the result i.e. Approval History appearing on my custom VF screen.
If you go to your object in the setup, create, objects, you should see the standard buttons, and have an option for override. Since you now are using the Standardcontroller with an extension, you can override directly with your VF page. If you were using a custom controller only, you could not.
You may want to override both the view and edit buttons.
The Recall Button is a standard button which comes as part of the standard Approval Process.
After submitting a record for approval, i can still recall it by clicking this button. But i am not sure how can I over-ride it?
Cool_D
Hello Jim,
I am back again with a query :)
Actually, i could display the Approval History with the method specified by you. But still i am facing an issue with the "History" related list of my Custom Object.
I can see the Parent-Child relationship in the WSDL with the name of "Histories", but when i try to display it on the custom VF screen, its gives an error saying this relationship is not valid.
I have added this on the standard page and have set the history tracking as well on some fields.
Can you please help me, if i am missing something? I am using this tag:
<apex:relatedList list="Histories" ></apex:relatedList>
Many Thanks,
Cool_D
Here is the code snippet that Ron posted, you would need change it from case, to your custom object:
great posts guys...
i have a (very) related question...........
managed to get the Approval History list on a VF page, but am struggling to get the 'Items to approve' related list to appear on a VF page.
tried a few variations, got as far as:
<apex:relatedList subject="{!contract} list="relatedApprovalList"> </apex:relatedList>
....but i need to reference the id of the record - in this case, a stanndard SF object - 'Contracts'. I've tried id="{!contract.id}", but no joy.
any ideas?
Mitesh