+ Start a Discussion

List Controller Views Error

I'm trying to create a basic multi-edit interface for a custom object using the standard controller for the custom object.

I want to use the custom views for the object specified in the object tab using the filterId code below.

          <apex:selectList value="{!filterId}" size="1">
            <apex:selectOptions value="{!listviewoptions}"/>
However, any view I load in my visualforce page with complex filter criteria raises an error like:

(toLabel(Presented__c) = 'Yes') AND 2) ORDER BY Outreach_Note__c.CreatedDate ^ ERROR at Row:1:Column:160 unexpected token: 2

If the filter criteria just operates on one field or two fields using the same comparison operator, the page works fine. But if I use a different comparison operator for two fields or anything of greater complexity, the error gets raised. Somewhere along the line the filter criteria is being translated into sql incorrectly.

Any ideas or work-arounds?


Message Edited by peek on 11-19-2008 12:56 PM
Great timing, I'm fixing this as we speak.

The workaround is to edit your filter definition, open your advanced filter options and surround them with ().  So instead of 1 AND 2, use (1 AND 2).
Awesome! That worked perfectly. Thanks so much!

Not to push my luck, but are there any options for basic sorting of results in the list w/ the standard controller? In the docs it seems to say you need a custom controller for that, but I'm just looking for very basic functionality (i.e., most recent on top instead of oldest).