Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Heavily edited...</p> <p>I don't think you can use a standard set controller for this. Using a custom controller I was able to get a consolidated list of opportunity contacts for the current user:</p> <p><img src="https://i.stack.imgur.com/P4EzZ.png" alt="enter image description here"></p> <p>Page:</p> <pre><code>&lt;apex:page controller="TestQueryController"&gt; &lt;apex:form &gt; &lt;apex:pageBlock &gt; &lt;apex:pageBlockTable value="{!opportunities}" var="co"&gt; &lt;apex:column value="{!co.Opportunity.CreatedDate}"/&gt; &lt;apex:column value="{!co.Contact.FirstName}"/&gt; &lt;apex:column value="{!co.Contact.LastName}"/&gt; &lt;apex:column headerValue="Stage"&gt; &lt;apex:inputField value="{!co.Opportunity.StageName}"/&gt; &lt;/apex:column&gt; &lt;/apex:pageBlockTable&gt; &lt;/apex:pageBlock&gt; &lt;/Apex:form&gt; &lt;/apex:page&gt; </code></pre> <p>Controller:</p> <pre><code>public with sharing class TestQueryController { List&lt;OpportunityContactRole&gt; myOCR; public List&lt;OpportunityContactRole&gt; getOpportunities() { if (myOCR == null) { myOCR = [SELECT Contact.Id, Opportunity.Id, Contact.FirstName, Contact.LastName, Contact.Phone, Contact.Account.Name, Contact.Email, Opportunity.Name, Opportunity.CloseDate, Opportunity.StageName, Opportunity.CreatedDate FROM OpportunityContactRole where Opportunity.OwnerId=:Userinfo.getUserId()]; } return myOCR; } } </code></pre> <p>You will need to substitute in your custom fields. If you need sorting, <a href="http://salesforcesource.blogspot.com/2008/11/adding-sorting-capability-to.html" rel="nofollow noreferrer">this blog post</a> gives one approach, though you can probably avoid repeat trips to the database using a wrapper class and the Apex <a href="http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_comparable.htm#apex_comparable" rel="nofollow noreferrer">Comparable</a> interface. Finally, you'll need to implement your own save logic. Good luck!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload