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
ptamkptamk 

StandardController ListView Problem

Hi I have two custom objects in my org  Quick_Quote_PRM__c and Payment_Credit__c
 
Both use the standardcontoller to display listview as follows
 
 
This one works
 
 
Code:
<apex:page showHeader="false" standardController="Quick_Quote_PRM__c" recordSetVar="pcs" >

   <apex:form id="theForm">
    <apex:outputLabel value="Select Payment View:" for="selectList"/>&nbsp;
       <apex:selectList value="{!filterId}" size="1" id="selectList">
         <apex:actionSupport event="onchange" rerender="list"/>
         <apex:selectOptions value="{!listviewoptions}"/>
       </apex:selectList>
        
   </apex:form>

</apex:page>

 
But this one doesnt
 
 
 
 
 
Code:
<apex:page showHeader="false" standardController="Payment_Credit__c" recordSetVar="pcs" >

   <apex:form id="theForm">
    <apex:outputLabel value="Select Payment View:" for="selectList"/>&nbsp;
       <apex:selectList value="{!filterId}" size="1" id="selectList">
         <apex:actionSupport event="onchange" rerender="list"/>
         <apex:selectOptions value="{!listviewoptions}"/>
       </apex:selectList>
        
   </apex:form>

</apex:page>

 
And fails with the following error
FROM Payment_Credit__c ORDER BY Name.Alias ASC LIMIT 10000 ^ ERROR at Row:1:Column:43 Didn't understand relationship 'Name' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
 
As can be seen there is no custom soql. Im not even referencing 'Name' ?
 
 
Is there some way to see what the query is been built by the standard controller ?
 
Any other ideas on how to debug ?
 
Thanks
Paul
 
 
 
 
 
 
 
 
 
 
 
 
 
 
JimRaeJimRae
Every custom object has a "Record Name Label" that creates a record name that is either a text or auto number field.  the API always refers to this as "Name"  Could you have done something to the Record name of the Payment_Credit__c object? Look at that object definition in your setup and see if it exists, it would be a standard field on the object, might be called "Payment Credit Name".
mtbclimbermtbclimber
Thanks for posting the message. The Visualforce team is looking into this as I do not believe you are doing anything wrong.
ptamkptamk

The problem appears to be that if I put a field that is a lookup in the first column of the view it generates invalid soql.

ie if the account (which is a lookup up to the account object) is placed first in the list view  then it generates invalid soql.

 

 

smackafeesmackafee

SHouldn't you use a different recordset for each column if you're using those two snippets together?