Note that there are some explanatory texts on larger screens.

plurals
  1. POSalesforce PageBlockTable Render an Item's Grandparent
    primarykey
    data
    text
    <p>I'm trying to display the grandparent of a custom Salesforce Object in a pageblocktable in a Visualforce page.</p> <p>I can display the parent as expected ie: </p> <pre><code>&lt;apex:column headerValue="Related Item Parent"&gt; &lt;apex:outputField id="ItemParent" value="{!item.Parent__c}" /&gt; &lt;/apex:column&gt; </code></pre> <p>works great and gives me a nice table with a 'Related Item Parent' column that is linked to the Item parent exactly as I wanted.</p> <p>but when I try to go up a further level, the Visualforce Page editor tells me</p> <blockquote> <p>Could not resolve the entity from value binding '{!item.Parent_<em>c.Parent</em>_c}'. can only be used with SObject fields.</p> </blockquote> <p>Is there anyway that this can be made to work? I'm a bit stuck!!</p> <p>Below is the complete listing for my pageBlockTable , which works correctly if the Related Item Grandparent column is removed.</p> <pre><code>&lt;apex:pageBlockTable id="RelatedItems" value="{!contact.RelatedItems__r}" var="item"&gt; &lt;apex:column headerValue="Related Item Name"&gt; &lt;apex:outputField id="ItemName" value="{!item.Name}" /&gt; &lt;/apex:column&gt; &lt;apex:column headerValue="Related Item Parent"&gt; &lt;apex:outputField id="ItemParent" value="{!item.Parent__c}" /&gt; &lt;/apex:column&gt; &lt;apex:column headerValue="Related Item Grandparent"&gt; &lt;apex:outputField id="ItemGrandParent" value="{!item.Parent__c.Parent__c}" /&gt; &lt;/apex:column&gt; &lt;/apex:pageBlockTable&gt; </code></pre> <p>Really appreciate any help that anybody can provide.</p> <p>Best regards</p> <p>Pete</p>
    singulars
    1. This table or related slice is empty.
    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. 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