You need to sign in to do that
Don't have an account?
John Neilan 2
Processinstance in VF Page
Hello,
I have a Visualforce page constructed on a custom object. I am using the standard controller for that object. I also have an Approval Process associated with the object. I am able to pull in the approval history with the <apex:relatedList List="ProcessSteps"> function. However, I would like to customize the related list to make it a bit more user-friendly. I know I can use <apex:facet> to control the header, footer, and body, but is there any way to pull in the different columns of the approval history? (e.g., {!processinstance.Status}, {!processinstance.AssignedTo}, etc.)
I have a Visualforce page constructed on a custom object. I am using the standard controller for that object. I also have an Approval Process associated with the object. I am able to pull in the approval history with the <apex:relatedList List="ProcessSteps"> function. However, I would like to customize the related list to make it a bit more user-friendly. I know I can use <apex:facet> to control the header, footer, and body, but is there any way to pull in the different columns of the approval history? (e.g., {!processinstance.Status}, {!processinstance.AssignedTo}, etc.)
<apex:relatedList> does not allow customizations except changing the size of record display.
Displaying records in <apex:pageblocktable> using a list from apex class querying process instance is the only solution that allows customizations.
Let me know if you found anyother alternative.
Regards,
Bharathimohan Rammaurthy
Salesforce For All (http://salesforceforall.blogspot.com/)
All Answers
<apex:relatedList> does not allow customizations except changing the size of record display.
Displaying records in <apex:pageblocktable> using a list from apex class querying process instance is the only solution that allows customizations.
Let me know if you found anyother alternative.
Regards,
Bharathimohan Rammaurthy
Salesforce For All (http://salesforceforall.blogspot.com/)
You can use <apex:pageBlaockTable>, <apex:dataTable> for showing the customize tables.
You can use the following objects to SOQL the Approval Process details.
ProcessInstance
SELECT Id, (SELECT Id, StepStatus, Comments FROM Steps) FROM ProcessInstance
- This query will query all Approval process and it's Steps
- Steps is the childRelationshipName for ProcessInstanceSteps
SELECT Id, (SELECT Id, ActorId, ProcessInstanceId FROM Workitems) FROM ProcessInstance.ProcessInstanceHistory :
Read Only object. Shows all steps and workitem associated with a ProcessInstance.
- SELECT Id, (SELECT Id, StepStatus, Comments FROM StepsAndWorkitems) FROM ProcessInstance.
- StepsAndWorkItems is the childRelationshipName for ProcessInstanceHistory.
ProcessInstanceWorkitem:ProcessInstanceStep:
Reference:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstance.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstancehistory.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstancestep.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstanceworkitem.htm
Thanks
Jai