0

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?

This is the Initial "Landing Page" Code for the Video Training...

Hi {!$User.FirstName}! 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>

The user would click one of the two links at the bottom of this page, depending on which "track" they wanted to follow. The links go to two similar, but different, Visualforce pages. The code is identical, except for the "filter" I need to add. Here is the code for those pages...

    <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>

Thanks

1

Without seeing how you are doing things (and assuming you may be using the same controller) your options would be:

Using a dynamic query in the controller:

  1. use apexPages.currentPage().getURL() and determine the page
  2. Based on the page set the where clause of the query

or

  1. Use a URL parameter say 'filterOn' as set it when calling the page:

either way you get the idea from the code below.

public string filterOn;

public className(){
   filterOn = apexPages.currentPage().getParameters().get('filterOn');
}

public DATATYPE[] getmyMethod(){
    String qry = 'Select xxx from xxx ';
    if(!string.isBlnak(filterOn)
       qry += ' Where FILENAME = :filterOn';

    return database.query(qry);
}

Note you will get a much better and more direct answer if you post your code :)

| improve this answer | |
  • Thanks Eric, I was worried about making the post too long. – Shawn Low Oct 15 '15 at 14:27
  • I will be adding the code itself in a minute. Please see if this helps...This is the initial "landing Page" for the Video Training.... – Shawn Low Oct 15 '15 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.