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
Sorcerer7Sorcerer7 

How do you filter the results on a pageBlock Table?

I have a new twist on this project.
I have created two (2) different Visualforce pages for two different training tracks we offer.
The pages are pretty simple, but they pull data from the same Custom Object in SFDC (Training and Certification).
I need to filter the results based on a field called "Course Track". Sales Professional videos need to populate on the sales professional page while sales engineer videos need to populate on the sales engineer page.
Is this possible?

Thanks
JeffreyStevensJeffreyStevens
Are you using a custom controller on the pages or the standard list controller?
Sorcerer7Sorcerer7
I am using a standard controller on a custom object.
Here's the code...
Initial Landing Page for Training...

<apex:page standardController="Training_Certification__c"  recordSetVar="Training_Certification__c" sidebar="false" >
    Hi {!$User.FirstName}!
       <apex:pageBlock >
              Welcome to Guidance Software's Certified Sales Professional (CSP) and Certified Sales Engineer (CSE) Courses
              
              <p>We are pleased to launch the first phase of our new sales-based curriculum designed exclusively for our channel partner community.  
              By completing both the Certified Sales Training (CSP) and Certified Sales Engineer (CSE) modules, partners will be moved up to the “Certified Partner”
              tier of the Guidance Global Partner Program, and with that comes many additional benefits, resources and additional discounts.</p>
      
              <p>Below is the "links" for our Certified Sales Professional (CSP) and Certified Sales Engineer (CSE) Courses.</p>
              <p>These programs are designed as a series of videos (ranging from 2-75 minutes each) on a variety of topics and solutions.</p>
          
              <p>Once you are ready to take the Certification Exam, click on the "Exam Request" link below to email ChannelHotline@guidancesoftware.com with a request for Exam Access.</p>
           
      </apex:pageBlock>
      
      <apex:pageBlock >
      
         <p><apex:outputLink value="https://guidance.force.com/partners/apex/Certified_Sales_Professional_Courses?sfdc.tabName=066F0000002KLxS">Certified Sales Professional (CSP) Courses</apex:outputLink></p>
         <p><apex:outputLink value="https://guidance.force.com/partners/apex/Certified_Sales_Engineer_Courses?sfdc.tabName=066F0000001mmVL">Certified Sales Engineer (CSE) Courses</apex:outputLink></p>
                  
      </apex:pageBlock>
 
 </apex:page>


Then there are two Visualforce pages, almost identical, one for Sales Professional Training and one for Sales Engineer Training.
Code looks like this...

<apex:page standardController="Training_Certification__c" recordSetVar="Training_Certification__c" sidebar="false">

        <h1> Welcome to Guidance Software's Certified Sales Professional (CSP) Courses </h1>

        <apex:pageBlock title="Guidance Software Certified Sales Professional (CSP) Videos">

            <apex:pageBlockTable value="{!Training_Certification__c}" var="a">

                  <apex:column value="{!a.Course_Code_v2__c}"/>

                 <apex:column value="{!a.Course_Level__c}"/>

                <apex:column value="{!a.Course_Description__c}"/>
                
                <apex:column value="{!a.Length__c}"/>
                
                                    
            </apex:pageBlockTable>

        </apex:pageBlock>

    </apex:page>