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
GRStevenBrookesGRStevenBrookes 

Simple List Of Records!

Hi,

New to Visualforce but am looking to do something quite simple! Display a list of records where Status__c is not 'Resolved'

 

This is what I have so far:

 

<apex:page standardController="Issues__c" recordSetVar="All Active Issues" tabStyle="Issues__c" sidebar="false" showHeader="false">
<apex:pageBlock title="Current Active Issues"></apex:pageBlock>
<apex:pageBlock >
      <apex:repeat value="{!Issues__c}" var="i"> 
         <apex:outputPanel rendered="true">
        {!i.Name},
        {!i.Status__c},
        </apex:outputPanel>
       </apex:repeat>
       </apex:pageBlock>
</apex:page>

 

 I would effectivly like the typical Salesforce GUI List View to be displayed (using criteria above)---- i have read through the manual but cant seem to grasp it - i am sure its looking me in the face!!

 

Any help much appreciated

 

Steve

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Naidu PothiniNaidu Pothini
<apex:page standardController="Issues__c" recordSetVar="Issues" tabStyle="Issues__c" sidebar="false" showHeader="false">
    <apex:pageBlock title="Current Active Issues">
        <apex:pageBlockTable value="{!Issues}" var="i">
            <apex:column value="{!i.Name}" headerValue="Name" rendered="{!IF(i.Status__c <> 'Resolved',true,false)}"/>
            <apex:column value="{!i.Status__c}" headerValue="Status" rendered="{!IF(i.Status__c <> 'Resolved',true,false)}"/>
        </apex:pageBlockTable>
   </apex:pageBlock>
</apex:page>

 Try this

 

Let me know if you do not want to display the records this way.

All Answers

Naidu PothiniNaidu Pothini
<apex:page standardController="Issues__c" recordSetVar="All Active Issues" tabStyle="Issues__c" sidebar="false" showHeader="false">
<apex:pageBlock title="Current Active Issues"></apex:pageBlock>
<apex:pageBlock >
      <apex:repeat value="{!Issues__c}" var="i"> 
         <apex:outputPanel rendered="{!IF(i.Status__c <> 'Resolved',true,false)}">
        {!i.Name},
        {!i.Status__c},
        </apex:outputPanel>
       </apex:repeat>
       </apex:pageBlock>
</apex:page>

 Try this. 

GRStevenBrookesGRStevenBrookes

thank you very much for this - im getting an odd error that cant seem to make sense of?

 

Error: KnownIssues line 7, column 10: The value of attribute "rendered" associated with an element type "apex:outputpanel" must not contain the '<' character

Error: The value of attribute "rendered" associated with an element type "apex:outputpanel" must not contain the '<' character.

Naidu PothiniNaidu Pothini

I have edited the post. please try it.

GRStevenBrookesGRStevenBrookes

thank you very much.

 

that has cleared the error - however no records are being returned? There should be! All i get is 2 commas?? Am i missing something?

Naidu PothiniNaidu Pothini
<apex:page standardController="Issues__c" recordSetVar="Issues" tabStyle="Issues__c" sidebar="false" showHeader="false">
    <apex:pageBlock title="Current Active Issues">
        <apex:pageBlockTable value="{!Issues}" var="i">
            <apex:column value="{!i.Name}" headerValue="Name" rendered="{!IF(i.Status__c <> 'Resolved',true,false)}"/>
            <apex:column value="{!i.Status__c}" headerValue="Status" rendered="{!IF(i.Status__c <> 'Resolved',true,false)}"/>
        </apex:pageBlockTable>
   </apex:pageBlock>
</apex:page>

 Try this

 

Let me know if you do not want to display the records this way.

This was selected as the best answer
GRStevenBrookesGRStevenBrookes

sorry -

 

Error: KnownIssues line 7, column 15: The end-tag for element type "apex:page" must end with a '>' delimiter

 

Naidu PothiniNaidu Pothini

Edited the last posted code. Try it.

GRStevenBrookesGRStevenBrookes

yes again, no error but no data.

Naidu PothiniNaidu Pothini

Try the above code.

GRStevenBrookesGRStevenBrookes

perfect!!! what was  the problem?

Naidu PothiniNaidu Pothini
recordSetVar="Issues"

 We have to use a name of the set of records passed to the page.