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

Items To Approve in visualforce page

is it possible to put the Items to Approve component from Home Tab to a visualforce page? how?

You can create a custom button for apporoval and place it on VF. Please refer following links for sample code:|StartTopic=Content%2Fapex_process_example.htm|SkinName=webhelp
Brian GlassBrian Glass
Does anyone have an answer for how or if this can be done?  The above reply did not address the question.
Sukhpreet Lotey 6Sukhpreet Lotey 6
Looking for the same answer
Mark GuildayMark Guilday
If anyone actually has some source code or an app that can actually answer the question I'd love to hear. Thanks
Your query code will be like:
public UsersItemsToApprove (ApexPages.StandardController controller) {


       public List<ProcessInstanceWorkitem> getWorkItems() {
        List<ProcessInstanceWorkitem> results = new List<ProcessInstanceWorkitem>();
        List<ProcessInstanceWorkitem> allitems = [SELECT ElapsedTimeInDays,, processInstance.targetObjectId,
     , processInstance.status,,
                FROM ProcessInstanceWorkitem
                WHERE ActorId= :UserInfo.getUserId()
                processInstance.status =: 'Pending'];
        for(ProcessInstanceWorkitem thisitem : allitems)
        return results;

and to put in a table in your page you run something like:
<apex:pageBlock title="Items to Approve" > 
 <apex:pageBlockTable value="{!WorkItems}" var="c" id="items" > 

<apex:column headerValue="Item"><apex:outputLink value="/{!}" target="_blank">{!}</apex:outputLink></apex:column> 
<apex:column headerValue="Submitted by" value="{!}"/>
<apex:column headerValue="Process" value="{!}"/>
<apex:column headerValue="Status" value="{!c.processInstance.status}"/>
<apex:column headerValue="Started Date" value="{!c.ProcessINstance.CreatedDate}"/>