You need to sign in to do that
Don't have an account?
Cool_Devloper
Approval History Related List in Custom VF Screen
Hello VF Gurus,
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>
Can someone please let me know what is that i am missing out here. Seems to be a very simple thing to do ... somehow still stuck :(
Any help will be very useful!!
Thanks,
Cool_D
P.S: I have already created an Approval Process for the Custom Object.
it's a bit more work than a normal related list, but it works.
Thanks for the reply Ron.
What i understand from your post is that, i can build my apex class and fetch the list of related records from it and display them as a related list.
But in my case, i want to display the "Approval History" as the related list. Will this workaround work in this case as well? How can i fetch those records, basically Approval Actions/Steps?
Moreover, i want to achieve the standard functionality of Salesforce Approval Process, giving the users, the option of submitting a record for approval and then the process is kicked off. (As it happens in the Standard Approval History Related List)
Is this possible? I am dead if this does'nt work :(
Thanks
Message Edited by Cool_Devloper on 12-28-2008 07:46 PM
you do have to construct / specify the columns that will appear, these would not be user configurable.
i believe you can add a simple button that begins the approval process, but i haven't tried this myself.
Hello Ron,
Thanks a ton for your useful answers.
I tried doing as per what you suggested. Unfortunately, landed into this exception:
"System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Plan__c.ProcessSteps"
I really am not able to figure out this issue. "Plan__c" is my cutom object.
Need help again :(
thanks
Hello Ron,
I was able to add the Approval History related list through "Controller Extension".
The issue now is that, for each event like submit, recall of that record to the approver, i am being redirected to the standard salesforce page but i want to redirect to my custom VF screen only.
Can you please let me know if there is way i can over-ride this standard functionality either through apex or through some other way?
Thanks in Advance....
you may have to url encode your retURL
But Ron,
How can i set the retURL as i dont know from where can i override the submit button. It is a part of the standard Approval process.
Is there a way to do so?
Thanks,
Cool_D
How did you add the approval history related list through the controller extension class?
I copied the VF code from the post, however I need a getHistories method in the the apex class. I am not sure what will be the return type of this method
Thanks,
Pooja
Got it.
List<Quote__History> histories = select .....
I missed the two underscores..I kept trying Quote_History.
Thanks,
Pooja
Pooja,
You can get these related list directly giving the Subject parameter in the related list component.
Anyways, good it worked for you!!
Cool_D
Hi ,
I have a slightly different problem.
We have a custom object where by Role Hierarchy , the logged in User has no access to record.
But using VF pages, i am bringing the records and displaying it.
I am able to list all the fields and the Non Access User is able to update the data also .
But now the main question, i tried using the point which you just mentioned.
<apex:relatedList list="ProcessSteps" subject="{!$CurrentPage.parameters.Id}" />
If i do this, the record is following ownership access logic.
The page says Insufficient Privileges.
Is there any way we can use the Data List or PageBlock in VF page for approval history also even though the user has no Record Level access..