• Kris Hankins
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 9
    Questions
  • 6
    Replies
I have a VF page that I am embedding into a tab on another VF page to provide search functionality on a custom object that I created. The page renders correctly, there are no VF errors or runtime errors for the controller. What I am having difficulty finding is why the search function(s) are failing to initiate. The controller was modified from a controller I found online. It seems to work well initially, pulling in the rental rates as it should. The problem comes when you enter criteria into the additional search fields. Nothing happens.


Custom Controller Code
 
public with sharing class RateSearchController {

  // the soql without the order and limit
  private String soql {get;set;}
  // the collection of Rates to display
  public List<Rental_Rate__c> rates {get;set;}

  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }

  // the current field to sort by. defaults to Name
  public String sortField {
    get  { if (sortField == null) {sortField = 'Name'; } return sortField;  }
    set;
  }

  // format the soql for display on the visualforce page
  public String debugSoql {
    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' ' + 'limit 200' ; }
    set;
  }

  // init the controller and display some sample data when the page loads
   public RateSearchController() {
    soql = 'select Name, Account__c, Active__c, Rental_Group__c, Discount_Level__c, Daily_Rate__c, Weekly_Rate__c, Monthly_Rate__c, Expiration_Date__c  from Rental_Rate__C ';
    runQuery();
  }
  

  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }

  // runs the actual query
  public void runQuery() {

    try {
      Rates = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' ' + 'limit 250');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops! Something went wrong!'));
    }

  }

  // runs the search with parameters passed via Javascript
  public PageReference runSearch() {

    String Name = Apexpages.currentPage().getParameters().get('Name');
    String Account = Apexpages.currentPage().getParameters().get('Account__c');
    String Active = Apexpages.currentPage().getParameters().get('Active__c');
    String Rental_Group = Apexpages.currentPage().getParameters().get('Rental_Group__c');
    String Daily_Rate = Apexpages.currentPage().getParameters().get('Daily_Rate__c');    
    String Weekly_Rate = Apexpages.currentPage().getParameters().get('Weekly_Rate__c');
    String Monthly_Rate = Apexpages.currentPage().getParameters().get('Montyly_Rate__c');
    String Expiration_Date = Apexpages.currentPage().getParameters().get('Expiration__Date');
    String Discounts = Apexpages.currentPage().getParameters().get('Discount_Level__c');
    

    soql = 'select Name, Account__c, Active__c, Discount_Level__c, Rental_Group__c, Daily_Rate__c, Weekly_Rate__c, Monthly_Rate__c, Expiration_Date__c  from Rental_Rate__C ';
    if (!Name.equals(''))
      soql += ' and Name LIKE \''+String.escapeSingleQuotes(Name)+'%\'';
    if (!Account.equals(''))
      soql += ' and Account LIKE \''+String.escapeSingleQuotes(Account)+'%\'';
    if (!Active.equals(''))
      soql += ' and Active LIKE \''+String.escapeSingleQuotes(Active)+'%\'';
    if (!Rental_Group.equals(''))
      soql += ' and Rental_Group LIKE \''+String.escapeSingleQuotes(Rental_Group)+'%\'';  
    if (!Daily_Rate.equals(''))
      soql += ' and Daily_Rate LIKE \''+String.escapeSingleQuotes(Daily_Rate)+'%\'';
    if (!Weekly_Rate.equals(''))
      soql += ' and Weekly_Rate LIKE \''+String.escapeSingleQuotes(Weekly_Rate)+'%\'';
    if (!Monthly_Rate.equals(''))
      soql += ' and Monthly_Rate LIKE \''+String.escapeSingleQuotes(Monthly_Rate)+'%\'';
    if (!Expiration_Date.equals(''))
      soql += ' and Expiration_Date LIKE \''+String.escapeSingleQuotes(Expiration_Date)+'%\'';
     if (!Discounts.equals(''))
      soql += ' and Discount_Level__c includes (\''+Discounts+'\')';

    // run the query again
    runQuery();

    return null;
  }
 public List<String> discounts {
    get {
      if (discounts == null) {

        discounts = new List<String>();
        Schema.DescribeFieldResult field = Rental_Rate__c.Discount_Level__c.getDescribe();

        for (Schema.PicklistEntry f : field.getPicklistValues())
          discounts.add(f.getLabel());

      }
      return discounts;          
    }
    set;
  }
  

}


VF Page that is being embedded

 
<apex:page controller="RateSearchController" sidebar="false" showHeader="false">

  <apex:form >
  <apex:pageMessages id="errors" />
  <apex:pageBlock title="Find Rental Rates" mode="edit">

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("Name").value,
          document.getElementById("Account__c").value,
          document.getElementById("Active__c").value,
          document.getElementById("Daily_Rate__c").value,
          document.getElementById("Weekly_Rate__c").value,
          document.getElementById("Monthly_Rate__c").value,
          document.getElementById("Expiration_Date__c").value,
          document.getElementById("Discount_Level__c").value
          );
      }
      </script> 

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="Name" value="" />
          <apex:param name="Account__c" value="" />
          <apex:param name="Rental_Group__c" value="" />
          <apex:param name="Discount_Level__c" value="" />
      </apex:actionFunction>

      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">Name<br/>
        <input type="text" id="Name" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Account<br/>
        <input type="text" id="Account" onkeyup="doSearch();"/>
        </td>
      </tr>
     
      <tr>
        <td style="font-weight:bold;">Rental Group<br/>
        <input type="text" id="Rental_Group" onkeyup="doSearch();"/>
        </td>
      </tr> 
      
      <tr>
        <td style="font-weight:bold;">Discount Level<br/>
          <select id="discounts" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!discounts}" var="disc">
              <option value="{!disc}">{!disc}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>     
     
     
      </table>
      
      

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!rates}" var="RatesList">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Rate Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Rental Group" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Rental_Group" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Rental_Group__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Account" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Account" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Account__c}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Discount Level" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="discounts" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Discount_Level__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Daily Rate" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Daily_Rate__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Daily_Rate__c}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Weekly Rate" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Weekly_Rate__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Weekly_Rate__c}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Monthly Rate" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Monthly_Rate__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Monthly_Rate__c}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Expiration Date" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Expiration_Date__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!RatesList.Expiration_Date__c}"/>
            </apex:column>




        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
  </table>

  
  </apex:pageBlock>

  </apex:form>

</apex:page>



 
I am trying to use visualstrap to create a panel that shows Opportunities on a visualforce page. The panel shows fine, the information shows fine.....except for the output link. That does not seem to be functioning. If you click on the link it just stays on the current page. 
 
<vs:panel title="Opportunity" type="primary">  
           <vs:well style="text-align:center;">  
              <vs:glyph icon="briefcase" style="font-size:40px"/>&nbsp;<span style="font-size:54px">{!Opportunities.size}</span>  
              <p class="text-muted">Opportunities</p>  
           </vs:well>  
           <apex:dataTable value="{!Opportunities}" var="opp" styleClass="table table-condensed table-hover table-bordered" rows="3">  
             <apex:column headerValue="Opp Name ">  
               <apex:outputLink onclick="return goToDetailPage('{!opp.ID}')" >{!opp.Name}</apex:outputLink>  
             </apex:column>  
             <apex:column value="{!opp.StageName}" headerValue="Stage"/>  
             <apex:column value="{!opp.Amount}" headerValue="Amount"/>  
           </apex:dataTable>  
           <vs:alert rendered="{!Opportunities.empty}" type="warning" style="text-align:center">  
             <vs:glyph icon="exclamation-sign"/> No records to display  
           </vs:alert>  
         </vs:panel>

The controller class pulls in the ID as seen in the snippet here
 
public List<Opportunity> getOpportunities(){
     return [SELECT Id, Name, AccountID, StageName, Amount FROM Opportunity WHERE OwnerId=:UserInfo.getUserId() ORDER BY LastViewedDate DESC];  
   }

I use pretty much the same thing for an Account list, and the output link works fine for the Accounts. 
 
<vs:panel title="Last Viewed Accounts" type="primary">  
           <apex:dataTable value="{!Accounts}" var="acc" styleClass="table table-condensed table-hover table-bordered" >  
             <apex:column headerValue="Name">  
               <apex:outputLink onclick="return goToDetailPage('{!acc.Id}')" >{!acc.Name}</apex:outputLink>  
             </apex:column>  
             <apex:column value="{!acc.Type}" headerValue="Type"/>  
             <apex:column value="{!acc.BillingState}" headerValue="State"/>  
           </apex:dataTable>  
           <vs:alert rendered="{!Accounts.empty}" type="warning" style="text-align:center">  
             <vs:glyph icon="exclamation-sign"/> No records to display  
           </vs:alert>  
         </vs:panel>

I'm not getting why the Opportunity link isn't redirecting me to the record's detail page. Any ideas? i also have this issue with the Contact output link not redirecting. 

 
I have some external objects in our org that I need to create a custom controller for. We have the Controller written, at least I believe it will work for what we need. My problem now is how do I test this controller in the sandbox since Lightning Connect is not enabled in our sandbox, only in production??

the controller code is below
 
public class NDSRentalContractController {
   Private final Account acct;
   public list<ER_HEADER__x> listContract   {get; set;}
   
   public NDSRentalContractController(ApexPages.StandardController stdController){
    this.acct = (Account) stdController.getRecord();
    listContract = [SELECT ExternalID, RH_OPEN_DATE__c from ER_HEADER__x WHERE RH1_CUSTOMER__c=:acct.NDS_Customer_Number__c];
   }    
}

 
Our org has a need for creating a custom link on the user page where it opens up a new window that displays a custom dashboard. I have all of that in place. What I need to do is add the filter criteria dynamically based on the {!User.Name} field. I am pulling two reports into the dashboard. One is an Opportunity report and the other is a custom object report. If I put two links on the User page layout I can assign the filter criteria no problem using ?pv0= but I can't find a way to pass this criteria over to a dashboard where it would need to be inserted into two separate reports. Any suggestions? 
I am looking for a way to render a VF page as a PDF that displays the OpportunityLineItem(s) from a given opportunity in the same VF page having a page break with every product. 

Rendering the Opportunity Product detail page as a pdf is not the issue. The issue I can't seem to resolve is when we have more than one Product on the Opportunity. How can I iterate through this list of Opportunity products and add each of them to the VF page? 

Our company sells serialized products and the prices on these products change from time to time depending on the manufacturer's pricing parameters. I am trying to create a button on the Opportunity page that brings up a new page (rendered as PDF) that list each Opportunity Product so our finance personnel can save this document to a shared drive as one document instead of printing out each individual Opportunity Product detail page. Any ideas on how I can do this?
I added an additional tab to a tabbed Account page last week. The new tab has two report charts on it. Everything functioned fine Friday. The reports were updating correctly and displaying the correct information without error. I log in tonight and click on that tab and I get "Error while running $A.run() : object is not a function". What gives? I checked trust.salesforce.com to see if the server instance was having issues. They are experiencing data export issues. The page still works fine in the sandbox. 

The code for the new tab is included here. 
<apex:tab label="Opportunity History"
                name="OppHistory" id="tabOppHistory">
                
                <apex:dataTable value="{!account}" var="Account" id="reportTable" rowClasses="odd,even" styleClass="tableClass">
                    <apex:Column >       
                             <analytics:reportChart reportId="00OE00000035A51"
                                       filter="{column:'Account.Name', operator:'equals', 
                                       value:'{!Account.Name}'}"> 
                            </analytics:reportChart>
                     </apex:column>
                          
                     <apex:column >
                            <analytics:reportChart reportId="00OL0000000PBEe"
                                     filter="{column:'Account.Name', operator:'equals', 
                                     value:'{!Account.Name}'}">
                            </analytics:reportChart>
                      </apex:column>  
              
                  </apex:dataTable>                    
                    
</apex:tab>

As I said, the page and reports work fine in the sandbox still. I'm hoping this is just a NA9 server instance issue. 
I have an apex class I found on line that will allow me to restrict a visualforce page override to specific Profiles, which is what I want to do. I have edited both VF pages to what I need them to be and implementing the apex class along with the VF pages works exactly how I need it to in the sandbox. I obviously have to create a test class for code coverage before moving this over to production. I ahve also found several tutorials on creating apex test classes, but none seem to cover what I need. Any assistance I can get on this would be great. 

The apex class is:

public class overrideCon {

   String recordId;    

public overrideCon(ApexPages.StandardController

       controller) {recordId = controller.getId();}
 

public PageReference redirect() {

  Profile p = [select name from Profile where id =

               :UserInfo.getProfileId()];

  if ('*Custom: Sales Pilot'.equals(p.name)

     )

      {

       PageReference customPage =  Page.tabbedAccount;

       customPage.setRedirect(true);

       customPage.getParameters().put('id', recordId);

       return customPage;

      } else {

          return null; //otherwise stay on the same page 
     

      }
   }

}

The tabbedAccount VF page is below:

<apex:page standardController="Account"  
   
    action="{!If($Profile.Name != '*Custom: Sales Rep' || $Profile.Name !='*Custom: PSSR' 
        || $Profile.Name !='*Custom: Executive'  ,
        null,
        urlFor($Action.Account.Tab, $ObjectType.Account,
        null, true))}"


        showHeader="true"
        tabStyle="account" >
 <style>
     .activeTab {background-color: red; color:white;
      background-image:none}
      .inactiveTab { background-color: lightgrey; color:black;
      background-image:none}
 </style>
 
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact">
<apex:relatedList subject="{!account}" list="contacts" />

</apex:tab>
<apex:tab label="Opportunities" name="Opportunities"
id="tabOpp">
<apex:relatedList subject="{!account}"
list="opportunities" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities"
id="tabOpenAct">
<apex:relatedList subject="{!account}"
list="OpenActivities" />
</apex:tab>
<apex:tab label="Notes and Attachments"
name="NotesAndAttachments" id="tabNoteAtt">
<apex:relatedList subject="{!account}"
list="CombinedAttachments" />
</apex:tab>
</apex:tabPanel>
</apex:page>

The standard Account page I will be using that contains the extension is:


<apex:page standardController="account" extensions="overrideCon" action="{!redirect}">

  <apex:detail />

</apex:page>


Our company implemented Salesforce about 15 months ago and we are now getting into creating callouts to consume data from different sources. We will be implementing a Customer Portal for our customers to be able to log in and track their equipment. The manufacturer has provided us with a URL to the site feed which will be providing the data. We will be creating the necessary custom objects in Salesforce to store the data and laying the foundation before the Cusotmer Portal becomes live. What I am interested in is creating the call out to the site to reqquest the data. We are looking at retrieving the data at the customer's request so real-time data would be ideal, but end-of-day stats would be doable as most of our customers only want to see what their equipment was doing for any given day anyway. 

Where can I find some documentation, tutorials, etc. on how to create this in Salesforce? 
I have been given the task of (possibly) creating a custom object for our customers to track their machines through an interface in salesforce cusotmer portal. The manufacturer has provided a website with the data feed I need as well as the log in information, field names, data types, etc. My problem is that I haven't done too much Apex coding. I'm presuming this would require a callout of some sort to establish a connection to the website. I can manipulate the data once it gets there, the problem is instantiating that connection. I have checked the forums but haven't found anything like what I need. I guess the best way to compare it would be like having a stock ticker on your website. I have done that using .NET, but that was a couple years ago. Any reference material out there I can read up on to get some tests going in the IDE? 
An exciting opportunity exists at Iraq and Afghanistan Veterans of America (IAVA), the leading nonprofit dedicated to serving our nation’s heroes and their families.

Our Salesforce team is growing and we are seeking a dynamic, hard-working Salesforce Specialist to bring on board. This position will have a unique opportunity to use their Salesforce skills and talents in innovative and exciting ways for a terrific cause.

The ideal candidate is skilled, dedicated, thoughtful, hard-working, detail-oriented, collaborative, and always hungry to exceed expectations. The Salesforce Specialist will assist in improving how IAVA utilizes Salesforce from fully leveraging the standard functionality and tools, to custom solutions like our policy engine, to the ground-breaking new MyIAVA.

The Salesforce Specialist reports to the Chief Digital Products Officer.

KEY RESPONSIBILITIES: 
TECHNICAL

Develop fields, objects, validation rules, triggers, approval processes, and custom code to address and improve new and existing business needs;
Update and maintain IAVA’s Salesforce user role/profile hierarchy in order for maximum compatibility with existing business processes and security requirements;
Data cleanup and maintenance using tools such as Demand Tools and Data Loader;
Drive the migration of any and all data currently residing in legacy systems and/or otherwise obsolete data sources (e.g. spreadsheets) in to Salesforce.

TRAINING AND ADOPTION

Support staff to define needs and show them how to get what they’re looking for out of Salesforce;
Manage system and data integrity by establishing end-user best practices, leveraging administrative tools and employing regressions testing.

PROJECT OWNERSHIP

Execute various deep-dive technical projects overseen by the Chief Technology Officer, sometimes working collaboratively, sometimes autonomously – examples include data cleanup, managing a new third-party software integration or composing documentations;
Engage in strategic thinking and planning about processes, vision, and improvements;
Other duties as assigned.

EXPERIENCE AND EDUCATION


2+ years of hands on salesforce.com experience;
Bachelors degree required, preferable in computer science or information systems;
Advanced degree computer science or information systems a plus ;
Salesforce.com Administrator Certification preferred;
Direct experience supporting end-users;
Excellent Microsoft Excel, Windows/Mac OSX, and Google Apps skills;
Experience with any of the following a plus: ExactTarget, FormAssembly, Conga Composer, Geopointe, Nonprofit Starter Pack;
Experience managing vendors/partners to develop software applications externally;
Background working in or with the non-profit sector.

TRAITS

Precision and quality focused;
Methodological, detail oriented, able to be careful and considerate under pressure;
Ability to meet deadlines, handle and prioritize multiple simultaneous requests, manage laterally and upwards, all with a professional and courteous attitude;
Ability to provide instruction to audiences of varying technical ability;
Excellent presentation and communication skills, both written and oral;
Comfortable working in a small, collaborative team environment;
Approachable and respectful;
A breadth and depth of knowledge and interest in the history and future of database management, cloud computing and web development;
High energy and passion for IAVA’s mission.

Start Date: Immediate

Application Deadline: Rolling

Salary and Benefits: Salary is commensurate with experience. IAVA provides comprehensive health and dental coverage, access to vision benefits, a Flexible Spending Account, Transportation Savings Account and a 403(b) retirement plan, in addition to thirty Paid Time Off days per year.

To Apply: Please complete our online application at www.iava.org/careers-iava.

Include a cover letter that concisely explains how your experience could be applied to IAVA. Applications without a cover letter will not be considered. No phone calls, please.

IAVA is an equal opportunity employer; VETERANS OF THE CONFLICTS IN IRAQ AND AFGHANISTAN ARE HIGHLY ENCOURAGED TO APPLY.

To learn more about IAVA’s history, mission and model, click here.
I added an additional tab to a tabbed Account page last week. The new tab has two report charts on it. Everything functioned fine Friday. The reports were updating correctly and displaying the correct information without error. I log in tonight and click on that tab and I get "Error while running $A.run() : object is not a function". What gives? I checked trust.salesforce.com to see if the server instance was having issues. They are experiencing data export issues. The page still works fine in the sandbox. 

The code for the new tab is included here. 
<apex:tab label="Opportunity History"
                name="OppHistory" id="tabOppHistory">
                
                <apex:dataTable value="{!account}" var="Account" id="reportTable" rowClasses="odd,even" styleClass="tableClass">
                    <apex:Column >       
                             <analytics:reportChart reportId="00OE00000035A51"
                                       filter="{column:'Account.Name', operator:'equals', 
                                       value:'{!Account.Name}'}"> 
                            </analytics:reportChart>
                     </apex:column>
                          
                     <apex:column >
                            <analytics:reportChart reportId="00OL0000000PBEe"
                                     filter="{column:'Account.Name', operator:'equals', 
                                     value:'{!Account.Name}'}">
                            </analytics:reportChart>
                      </apex:column>  
              
                  </apex:dataTable>                    
                    
</apex:tab>

As I said, the page and reports work fine in the sandbox still. I'm hoping this is just a NA9 server instance issue. 
I have created a VF Page to set the Finish Location for my Flow.  However, when I attempt to use the button, I am receiving an error - URL No Longer Exists.  Any ideas?

<apex:page id="theTransferPage" standardcontroller="SCMC__Sales_Order__c">
    <apex:variable var="theReplacementTransfer" value="{!SCMC__Sales_Order__c.Id}"></apex:variable>
    <div style="float: left; width: 600px; padding: 10px;">
            <flow:interview name="ReplacementTransferRequest" finishLocation="{!URLFOR('/'+theReplacementTransfer)}" >
                    <apex:param name="varSalesOrderID" value="{!SCMC__Sales_Order__c.Id}"/>
                    <apex:param name="varOwnershipID" value="{!SCMC__Sales_Order__c.SCMC__Ownership__c}"/>
                    <apex:param name="varComments" value="{!SCMC__Sales_Order__c.SCMC__Sales_Representative_Instructions__c}"/>
            </flow:interview>
        </div>
</apex:page>
I have an apex class I found on line that will allow me to restrict a visualforce page override to specific Profiles, which is what I want to do. I have edited both VF pages to what I need them to be and implementing the apex class along with the VF pages works exactly how I need it to in the sandbox. I obviously have to create a test class for code coverage before moving this over to production. I ahve also found several tutorials on creating apex test classes, but none seem to cover what I need. Any assistance I can get on this would be great. 

The apex class is:

public class overrideCon {

   String recordId;    

public overrideCon(ApexPages.StandardController

       controller) {recordId = controller.getId();}
 

public PageReference redirect() {

  Profile p = [select name from Profile where id =

               :UserInfo.getProfileId()];

  if ('*Custom: Sales Pilot'.equals(p.name)

     )

      {

       PageReference customPage =  Page.tabbedAccount;

       customPage.setRedirect(true);

       customPage.getParameters().put('id', recordId);

       return customPage;

      } else {

          return null; //otherwise stay on the same page 
     

      }
   }

}

The tabbedAccount VF page is below:

<apex:page standardController="Account"  
   
    action="{!If($Profile.Name != '*Custom: Sales Rep' || $Profile.Name !='*Custom: PSSR' 
        || $Profile.Name !='*Custom: Executive'  ,
        null,
        urlFor($Action.Account.Tab, $ObjectType.Account,
        null, true))}"


        showHeader="true"
        tabStyle="account" >
 <style>
     .activeTab {background-color: red; color:white;
      background-image:none}
      .inactiveTab { background-color: lightgrey; color:black;
      background-image:none}
 </style>
 
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact">
<apex:relatedList subject="{!account}" list="contacts" />

</apex:tab>
<apex:tab label="Opportunities" name="Opportunities"
id="tabOpp">
<apex:relatedList subject="{!account}"
list="opportunities" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities"
id="tabOpenAct">
<apex:relatedList subject="{!account}"
list="OpenActivities" />
</apex:tab>
<apex:tab label="Notes and Attachments"
name="NotesAndAttachments" id="tabNoteAtt">
<apex:relatedList subject="{!account}"
list="CombinedAttachments" />
</apex:tab>
</apex:tabPanel>
</apex:page>

The standard Account page I will be using that contains the extension is:


<apex:page standardController="account" extensions="overrideCon" action="{!redirect}">

  <apex:detail />

</apex:page>


An exciting opportunity exists at Iraq and Afghanistan Veterans of America (IAVA), the leading nonprofit dedicated to serving our nation’s heroes and their families.

Our Salesforce team is growing and we are seeking a dynamic, hard-working Salesforce Specialist to bring on board. This position will have a unique opportunity to use their Salesforce skills and talents in innovative and exciting ways for a terrific cause.

The ideal candidate is skilled, dedicated, thoughtful, hard-working, detail-oriented, collaborative, and always hungry to exceed expectations. The Salesforce Specialist will assist in improving how IAVA utilizes Salesforce from fully leveraging the standard functionality and tools, to custom solutions like our policy engine, to the ground-breaking new MyIAVA.

The Salesforce Specialist reports to the Chief Digital Products Officer.

KEY RESPONSIBILITIES: 
TECHNICAL

Develop fields, objects, validation rules, triggers, approval processes, and custom code to address and improve new and existing business needs;
Update and maintain IAVA’s Salesforce user role/profile hierarchy in order for maximum compatibility with existing business processes and security requirements;
Data cleanup and maintenance using tools such as Demand Tools and Data Loader;
Drive the migration of any and all data currently residing in legacy systems and/or otherwise obsolete data sources (e.g. spreadsheets) in to Salesforce.

TRAINING AND ADOPTION

Support staff to define needs and show them how to get what they’re looking for out of Salesforce;
Manage system and data integrity by establishing end-user best practices, leveraging administrative tools and employing regressions testing.

PROJECT OWNERSHIP

Execute various deep-dive technical projects overseen by the Chief Technology Officer, sometimes working collaboratively, sometimes autonomously – examples include data cleanup, managing a new third-party software integration or composing documentations;
Engage in strategic thinking and planning about processes, vision, and improvements;
Other duties as assigned.

EXPERIENCE AND EDUCATION


2+ years of hands on salesforce.com experience;
Bachelors degree required, preferable in computer science or information systems;
Advanced degree computer science or information systems a plus ;
Salesforce.com Administrator Certification preferred;
Direct experience supporting end-users;
Excellent Microsoft Excel, Windows/Mac OSX, and Google Apps skills;
Experience with any of the following a plus: ExactTarget, FormAssembly, Conga Composer, Geopointe, Nonprofit Starter Pack;
Experience managing vendors/partners to develop software applications externally;
Background working in or with the non-profit sector.

TRAITS

Precision and quality focused;
Methodological, detail oriented, able to be careful and considerate under pressure;
Ability to meet deadlines, handle and prioritize multiple simultaneous requests, manage laterally and upwards, all with a professional and courteous attitude;
Ability to provide instruction to audiences of varying technical ability;
Excellent presentation and communication skills, both written and oral;
Comfortable working in a small, collaborative team environment;
Approachable and respectful;
A breadth and depth of knowledge and interest in the history and future of database management, cloud computing and web development;
High energy and passion for IAVA’s mission.

Start Date: Immediate

Application Deadline: Rolling

Salary and Benefits: Salary is commensurate with experience. IAVA provides comprehensive health and dental coverage, access to vision benefits, a Flexible Spending Account, Transportation Savings Account and a 403(b) retirement plan, in addition to thirty Paid Time Off days per year.

To Apply: Please complete our online application at www.iava.org/careers-iava.

Include a cover letter that concisely explains how your experience could be applied to IAVA. Applications without a cover letter will not be considered. No phone calls, please.

IAVA is an equal opportunity employer; VETERANS OF THE CONFLICTS IN IRAQ AND AFGHANISTAN ARE HIGHLY ENCOURAGED TO APPLY.

To learn more about IAVA’s history, mission and model, click here.
I'm working on an integration between our client's Salesforce org and a third party.  They have a few REST API's that I need to call from Apex code and receive back some JSON data.  They have provided pretty good documentation.  They are using OAuth 2.0 for authentication.  The code will need to be run on a scheduled basis and may also be initiated by a user.  I'm a pretty skilled Windows developer in a variety of languages but am new to the force.com platform.  Any resources or sample code you could point me at would be much appreciated.