• Chiho Sullivan
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies
We have added WPForms as a connected app to Salesforce. However, it is not integrating any applications that get submitted. We talked to WPForms support and they said everything looks good on their end and to contact Salesforce to see what is going on. Salesforce told us WPForms is not listed in my installed packages but shows up under connected apps. Can anyone help us? Thank you!
First off, I am a volunteer with a non-profit.  They've asked me to help do something very simple but this is not my area of expertise.  They would like an online form to populate a picklist field with a default value (Online_Referral__c; picklist options Yes or No), insert a record, then redirect to a thank you page.  I understand how this all needs to work and how the objects and VF pages need to be created but I can't get the controller extension and test to work.  When I used the below, all tests passed in the sandbox but when I try to load it to production I get the following error:   Apex Class Invalid Type:  TrainingAgencyReferralSaveAndThankYou.  I just think that what I created has some very basic issues that hopefully someone with much ore experience than me can help me to correct.  I know our non-profit would be very appreciative!

Controller Extension
public class TrainingAgencyReferralSaveAndThankYou {
Referrals__c referrals;
public TrainingAgencyReferralSaveAndThankYou(ApexPages.StandardController controller){
this.controller = controller;   
}

public PageReference saveAndThankYou() {
Referrals.Online_Referral__c = 'Yes';
controller.save();
PageReference ThankYouPage = Page.TrainingReferralThankYou;
ThankYouPage.setRedirect(true);
return ThankYouPage;
}
private final ApexPages.StandardController controller;


Test
@isTest
public with sharing class KFGCreateTrainingReferralControllerTest {
    //==================== TEST METHOD(s) ======================================
    static testMethod void KFGCreateTrainingReferralControllerTest() {
    
    Referrals__c newReferrals = new Referrals__c();
   
        // Test insert Referrals__c
        newReferrals.Referral_Date__c = Date.Today();
        newReferrals.Referrer_First_Name__c = 'TestFirstName';
        newReferrals.Referrer_Last_Name__c = 'TestLastName';
        newReferrals.Referrer_Title__c = 'TestTitle';
        newReferrals.Agency__c = 'TestAgency';
        newReferrals.Email__c = 'testemail@test.com';
        newReferrals.Work_Phone__c = '619-111-2222';
        newReferrals.Mobile_Phone__c = '858-999-8888';
        newReferrals.Street_Address__c = 'TestAddress';
        newReferrals.City__c = 'San Diego';
        newReferrals.State__c = 'CA';
        newReferrals.Zip_Code__c = 92111;
        newReferrals.Referral_for_Class_Number__c = 8;
        newReferrals.Client_First_Name__c = 'ClientFirst';
        newReferrals.Client_Last_Name__c = 'ClientLast';
        newReferrals.Client_Phone__c = '800-555-7777';
        newReferrals.Client_Email__c = 'clientemail@test.com';
        newReferrals.Reason_for_Referral__c = 'TestReasonforReferral';
        newReferrals.Why_is_the_Client_Under_Your_Care__c = 'TestWhyUnderCare';
        newReferrals.How_Long_Have_You_Been_Working_Together__c = 'TestHowLongWorkingTogether';
        newReferrals.How_Often_Do_You_Communicate__c = 'TestHowOftenCommunicate';
        newReferrals.How_Often_Do_You_Meet__c = 'TestHowOftenMeet';
        newReferrals.What_Agencies_Do_You_Collaborate_With__c = 'TestAgencyCollaboration';
        newReferrals.What_Are_the_Clients_Goals__c = 'TestClient Goals';
        newReferrals.What_Are_The_Clients_Current_Challenges__c = 'TestClientChallenges';
        newReferrals.Challenges_You_Have_With_the_Client__c = 'TestChallengesWithClient';
        newReferrals.Will_You_Maintain_Collaborative_Support__c = 'Yes';
        newReferrals.Applicant_8_30am_4_30pm_Attendace_Issues__c = 'No';
        newReferrals.Specify_Time_Restrictions_Day_and_Time__c = 'TestTimeDayRestrictions';
        newReferrals.Signature__c = 'TestSignature';
        newReferrals.Date__c = Date.Today();
 insert newReferrals;
 ApexPages.StandardController controller = new ApexPages.StandardController(newReferrals);
    TrainingAgencyReferralSaveAndThankYou testnewReferral = new TrainingAgencyReferralSaveAndThankYou(controller);
    system.assertEquals(Page.TrainingReferralThankYou.getURL(), testnewReferral.saveAndThankYou().getURL());
 System.Assert(newReferrals.Id != null, 'The Referral did not insert properly, please check validation, workflows, etc.');
 
  Referrals__c newReferralsObj = [select Online_Referral__c from Referrals__c where id = :newReferrals.id ];
 
    System.AssertEquals(newReferralsObj.Online_Referral__c = 'Yes','The Online Referral field was not able to update.');
    }  
}

VF Page (not formatted version)
<apex:page sidebar="false" showHeader="false" standardController="Referrals__c" extensions="TrainingAgencyReferralSaveAndThankYou">  

    <div id="intro">
Please complete all fields before submitting the Agency Referral Form.  Also, if you have not done so already, please have your client complete the Project Launch Culinary Job Training Application.  Applicants can view program requirements and complete their online application at <a href="http://kitchensforgood.org/culinary-job-training/" style="color:blue">http://kitchensforgood.org/culinary-job-training/</a>.  Applicants can also submit a <a href="KFGTrainingApplication" style="color:blue">hard copy application</a> to <a href="training@kitchensforgood.org" style="color:blue">training@kitchensforgood.org</a> or at 404 Euclid Avenue, San Diego, CA 92114.
    </div>
    <apex:form >
    <div id="onlineform">
        <apex:inputHidden value="{!Referrals__c.Online_Referral__c}"/>
    </div>
    <div id="referreragencyinformation">
        First Name<apex:inputfield value="{!Referrals__c.Referrer_First_Name__c}"/>
        Last Name<apex:inputfield value="{!Referrals__c.Referrer_Last_Name__c}"/>
        Title<apex:inputfield value="{!Referrals__c.Referrer_Title__c}"/>
        Agency<apex:inputfield value="{!Referrals__c.Agency__c}"/>
        Email<apex:inputfield value="{!Referrals__c.Email__c}"/>
        Work Phone<apex:inputfield value="{!Referrals__c.Work_Phone__c}"/>
        Mobile Phone<apex:inputfield value="{!Referrals__c.Mobile_Phone__c}"/>       
        Street Address<apex:inputfield value="{!Referrals__c.Street_Address__c}"/>       
        City<apex:inputfield value="{!Referrals__c.City__c}"/>       
        State<apex:inputfield value="{!Referrals__c.State__c}"/>       
        Zip Code<apex:inputfield value="{!Referrals__c.Zip_Code__c}"/>       
    </div>       
   
    <div id="generalreferralandclientinformation">
        Referral Date<apex:inputfield value="{!Referrals__c.Referral_Date__c}"/>
        Referral For Class Number<apex:inputfield value="{!Referrals__c.Referral_for_Class_Number__c}"/>
        Client First Name<apex:inputfield value="{!Referrals__c.Client_First_Name__c}"/>
        Client Last Name<apex:inputfield value="{!Referrals__c.Client_Last_Name__c}"/>
        Client Phone<apex:inputfield value="{!Referrals__c.Client_Phone__c}"/>
        Client Email<apex:inputfield value="{!Referrals__c.Client_Email__c}"/>
    </div>       
    <div id="referrerandclientrelationshipinformation">
        Reason for Referral<apex:inputfield value="{!Referrals__c.Reason_for_Referral__c}"/>       
        Why is the Client Under Your Care<apex:inputfield value="{!Referrals__c.Why_is_the_Client_Under_Your_Care__c}"/>
        How Long Have You Been Working Together<apex:inputfield value="{!Referrals__c.How_Long_Have_You_Been_Working_Together__c}"/>
        How Often Do You Communicate<apex:inputfield value="{!Referrals__c.How_Often_Do_You_Communicate__c}"/>
        How Often Do You Meet<apex:inputfield value="{!Referrals__c.How_Often_Do_You_Meet__c}"/>
        What Other Agencies Do You and Your Client Collaborate With<apex:inputfield value="{!Referrals__c.What_Agencies_Do_You_Collaborate_With__c}"/>
        What Are the Client's Short and Long Term Goals<apex:inputfield value="{!Referrals__c.What_Are_the_Clients_Goals__c}"/>
        What Are the Client's Current Challenges<apex:inputfield value="{!Referrals__c.What_Are_The_Clients_Current_Challenges__c}"/>       
        What Challenges Do You Have With the Client<apex:inputfield value="{!Referrals__c.Challenges_You_Have_With_the_Client__c}"/>       
        Anything Else We Should Know<apex:inputfield value="{!Referrals__c.Anything_Else_We_Should_Know__c}"/>       
    </div>       
    <div id="continuedcollaborationclientattendancesignature">
        Kitchens for Good is a training program, and will not take the place of any social service agency the client is/will be utilizing. Are you willing to maintain collaborative support (maintain an open line of communication, attend meetings, etc.) with Kitchens for Good to promote the overall well-being of the client?<apex:inputfield value="{!Referrals__c.Will_You_Maintain_Collaborative_Support__c}"/>
        Are there any restrictions that would prohibit/interfere with the client’s ability to participate Monday through Friday from 8:30am-4:30pm?<apex:inputfield value="{!Referrals__c.Applicant_8_30am_4_30pm_Attendace_Issues__c}"/>
        Specify Attendance Time Restrictions (Day and Time)<apex:inputfield value="{!Referrals__c.Specify_Time_Restrictions_Day_and_Time__c}"/>
        Signature<apex:inputfield value="{!Referrals__c.Signature__c}"/>
        Date<apex:inputfield value="{!Referrals__c.Date__c}"/>
    </div>       
       
    <apex:commandButton value="Save" action="{!saveAndThankYou}"/>
    </apex:form>   
</apex:page>
I can't seem to figure out why i get the following error; i've included my controller extension, test class, and VF page.  Can someone help me...it seems like it should be pretty simple? 

Error
System.NullPointerException: Attempt to de-reference a null object. 

Stack Trace:  Class.TrainingAgencyReferralSaveAndThankYou.saveAndThankYou: line 8, column 1
Class.KFGCreateTrainingReferralControllerTest.KFGCreateTrainingReferralControllerTest: line 45, column 1

Controller Extension
public class TrainingAgencyReferralSaveAndThankYou {
Referrals__c referrals;
public TrainingAgencyReferralSaveAndThankYou(ApexPages.StandardController controller){
this.controller = controller;   
}

public PageReference saveAndThankYou() {
Referrals.Online_Referral__c = 'Yes';
controller.save();
PageReference ThankYouPage = Page.TrainingReferralThankYou;
ThankYouPage.setRedirect(true);
return ThankYouPage;
}
private final ApexPages.StandardController controller;
}

Test Class
@isTest
public with sharing class KFGCreateTrainingReferralControllerTest {
    //==================== TEST METHOD(s) ======================================
    static testMethod void KFGCreateTrainingReferralControllerTest() {
     
    Referrals__c newReferrals = new Referrals__c();
    
        // Test insert Referrals__c
        newReferrals.Referral_Date__c = Date.Today();
        newReferrals.Referrer_First_Name__c = 'TestFirstName';
        newReferrals.Referrer_Last_Name__c = 'TestLastName';
        newReferrals.Referrer_Title__c = 'TestTitle';
        newReferrals.Agency__c = 'TestAgency';
        newReferrals.Email__c = 'testemail@test.com';
        newReferrals.Work_Phone__c = '619-111-2222';
        newReferrals.Mobile_Phone__c = '858-999-8888';
        newReferrals.Street_Address__c = 'TestAddress';
        newReferrals.City__c = 'San Diego';
        newReferrals.State__c = 'CA';
        newReferrals.Zip_Code__c = 92111;
        newReferrals.Referral_for_Class_Number__c = 8;
        newReferrals.Client_First_Name__c = 'ClientFirst';
        newReferrals.Client_Last_Name__c = 'ClientLast';
        newReferrals.Client_Phone__c = '800-555-7777';
        newReferrals.Client_Email__c = 'clientemail@test.com';
        newReferrals.Reason_for_Referral__c = 'TestReasonforReferral';
        newReferrals.Why_is_the_Client_Under_Your_Care__c = 'TestWhyUnderCare';
        newReferrals.How_Long_Have_You_Been_Working_Together__c = 'TestHowLongWorkingTogether';
        newReferrals.How_Often_Do_You_Communicate__c = 'TestHowOftenCommunicate';
        newReferrals.How_Often_Do_You_Meet__c = 'TestHowOftenMeet';
        newReferrals.What_Agencies_Do_You_Collaborate_With__c = 'TestAgencyCollaboration';
        newReferrals.What_Are_the_Clients_Goals__c = 'TestClient Goals';
        newReferrals.What_Are_The_Clients_Current_Challenges__c = 'TestClientChallenges';
        newReferrals.Challenges_You_Have_With_the_Client__c = 'TestChallengesWithClient';
        newReferrals.Will_You_Maintain_Collaborative_Support__c = 'Yes';
        newReferrals.Applicant_8_30am_4_30pm_Attendace_Issues__c = 'No';
        newReferrals.Specify_Time_Restrictions_Day_and_Time__c = 'TestTimeDayRestrictions';
        newReferrals.Signature__c = 'TestSignature';
        newReferrals.Date__c = Date.Today();
 insert newReferrals;
 ApexPages.StandardController controller = new ApexPages.StandardController(newReferrals);
    TrainingAgencyReferralSaveAndThankYou testnewReferral = new TrainingAgencyReferralSaveAndThankYou(controller);
    system.assertEquals(Page.TrainingReferralThankYou.getURL(), testnewReferral.saveAndThankYou().getURL());
 System.Assert(newReferrals.Id != null, 'The Referral did not insert properly, please check validation, workflows, etc.');
    System.AssertEquals(newReferrals.Online_Referral__c = 'Yes','The Online Referral field was not able to update.');
    }   
}

VF Page
<apex:page sidebar="false" showHeader="false" standardController="Referrals__c" extensions="TrainingAgencyReferralSaveAndThankYou">  
   <apex:insert name="KFGheader" >
    <c:KFGSiteHeader_Training />
    </apex:insert>
   
            <table class="Header">
            <tr>
            <td class="HeaderTD" style="text-indent: 22px"><b>PROJECT LAUNCH CULINARY JOB TRAINING AGENCY REFERAL FORM</b></td>
            </tr>
            </table>
    <div id="intro">
<!--must update the link to the hard copy attachemnt when done-->
    Please complete all fields before submitting the Agency Referral Form.  Also, if you have not done so already, please have your client complete the Project Launch Culinary Job Training Application.  Applicants can view program requirements and complete their online application at <a href="http://kitchensforgood.org/culinary-job-training/" style="color:blue">http://kitchensforgood.org/culinary-job-training/</a>.  Applicants can also submit a <a href="KFGTrainingApplication" style="color:blue">hard copy application</a> to <a href="training@kitchensforgood.org" style="color:blue">training@kitchensforgood.org</a> or at 404 Euclid Avenue, San Diego, CA 92114.
    </div>
    <apex:form >
    <div id="onlineform">
        <apex:inputHidden value="{!Referrals__c.Online_Referral__c}"/>
    </div>
    <div id="referreragencyinformation">
        First Name<apex:inputfield value="{!Referrals__c.Referrer_First_Name__c}"/>
        Last Name<apex:inputfield value="{!Referrals__c.Referrer_Last_Name__c}"/>
        Title<apex:inputfield value="{!Referrals__c.Referrer_Title__c}"/>
        Agency<apex:inputfield value="{!Referrals__c.Agency__c}"/>
        Email<apex:inputfield value="{!Referrals__c.Email__c}"/>
        Work Phone<apex:inputfield value="{!Referrals__c.Work_Phone__c}"/>
        Mobile Phone<apex:inputfield value="{!Referrals__c.Mobile_Phone__c}"/>       
        Street Address<apex:inputfield value="{!Referrals__c.Street_Address__c}"/>       
        City<apex:inputfield value="{!Referrals__c.City__c}"/>       
        State<apex:inputfield value="{!Referrals__c.State__c}"/>       
        Zip Code<apex:inputfield value="{!Referrals__c.Zip_Code__c}"/>       
    </div>       
   
    <div id="generalreferralandclientinformation">
        Referral Date<apex:inputfield value="{!Referrals__c.Referral_Date__c}"/>
        Referral For Class Number<apex:inputfield value="{!Referrals__c.Referral_for_Class_Number__c}"/>
        Client First Name<apex:inputfield value="{!Referrals__c.Client_First_Name__c}"/>
        Client Last Name<apex:inputfield value="{!Referrals__c.Client_Last_Name__c}"/>
        Client Phone<apex:inputfield value="{!Referrals__c.Client_Phone__c}"/>
        Client Email<apex:inputfield value="{!Referrals__c.Client_Email__c}"/>
    </div>       
    <div id="referrerandclientrelationshipinformation">
        Reason for Referral<apex:inputfield value="{!Referrals__c.Reason_for_Referral__c}"/>       
        Why is the Client Under Your Care<apex:inputfield value="{!Referrals__c.Why_is_the_Client_Under_Your_Care__c}"/>
        How Long Have You Been Working Together<apex:inputfield value="{!Referrals__c.How_Long_Have_You_Been_Working_Together__c}"/>
        How Often Do You Communicate<apex:inputfield value="{!Referrals__c.How_Often_Do_You_Communicate__c}"/>
        How Often Do You Meet<apex:inputfield value="{!Referrals__c.How_Often_Do_You_Meet__c}"/>
        What Other Agencies Do You and Your Client Collaborate With<apex:inputfield value="{!Referrals__c.What_Agencies_Do_You_Collaborate_With__c}"/>
        What Are the Client's Short and Long Term Goals<apex:inputfield value="{!Referrals__c.What_Are_the_Clients_Goals__c}"/>
        What Are the Client's Current Challenges<apex:inputfield value="{!Referrals__c.What_Are_The_Clients_Current_Challenges__c}"/>       
        What Challenges Do You Have With the Client<apex:inputfield value="{!Referrals__c.Challenges_You_Have_With_the_Client__c}"/>       
        Anything Else We Should Know<apex:inputfield value="{!Referrals__c.Anything_Else_We_Should_Know__c}"/>       
    </div>       
    <div id="continuedcollaborationclientattendancesignature">
        Kitchens for Good is a training program, and will not take the place of any social service agency the client is/will be utilizing. Are you willing to maintain collaborative support (maintain an open line of communication, attend meetings, etc.) with Kitchens for Good to promote the overall well-being of the client?<apex:inputfield value="{!Referrals__c.Will_You_Maintain_Collaborative_Support__c}"/>
        Are there any restrictions that would prohibit/interfere with the client’s ability to participate Monday through Friday from 8:30am-4:30pm?<apex:inputfield value="{!Referrals__c.Applicant_8_30am_4_30pm_Attendace_Issues__c}"/>
        Specify Attendance Time Restrictions (Day and Time)<apex:inputfield value="{!Referrals__c.Specify_Time_Restrictions_Day_and_Time__c}"/>
        Signature<apex:inputfield value="{!Referrals__c.Signature__c}"/>
        Date<apex:inputfield value="{!Referrals__c.Date__c}"/>
    </div>       
       
    <apex:commandButton value="Save" action="{!saveAndThankYou}"/>
    </apex:form>   
</apex:page>
been at this for hours and can't seem to figure out why my test class  isn't covering the following controller code:     } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new application.'));
      return null;
        }.

i do have a few workflow rules that are active but the initial insert of a new record would not fire any of these off...would that have an impact?

Controller is
public class KFGCreateTrainingApplicationController {

    public Applications__c applications {get; set;}
   
   // blank constructor
    public KFGCreateTrainingApplicationController() {
  applications = new Applications__c();
    }

  // save button is clicked
    public PageReference save() {
        try {
            upsert(applications); // inserts the new record into the database
        } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new application.'));
      return null;
        }
       
    // if successfully inserted new application, then displays the thank you page.
    return Page.TrainingApplicationThankYou;
    }
}


Test Is:
@isTest
public with sharing class KFGCreateTrainingAppControllerTest {
    //==================== TEST METHOD(s) ======================================
    static testMethod void KFGCreateTrainingAppControllerTest() {
     
  Applications__c newApplications = new Applications__c();
   
        // Test insert Applications__c
        newApplications.Application_Date__c = Date.Today();
        newApplications.Online_Application__c = 'Yes';
        newApplications.Class_Number_Being_Applied_For__c = 1; 
        newApplications.Applicant_First_Name__c = 'TestFirstName';
        newApplications.Applicant_Last_Name__c = 'TestLastName';
        newApplications.Age__c = 24;
        newApplications.Gender__c = 'Female';
        newApplications.Race__c = 'Latino/Hispanic';
        newApplications.Email__c = 'testreferrer@test.com';
        newApplications.State__c = 'ca';
        newApplications.Are_You_A_Current_or_Former_Foster_Youth__c = 'Yes';
        newApplications.Are_You_a_Domestic_Violence_Victim__c = 'Yes';       
        newApplications.Did_You_Attend_College__c = 'No';
        newApplications.Did_You_Attend_High_School__c = 'No';       
        newApplications.Have_You_Had_Vocational_Training__c = 'No';
        newApplications.Did_You_Serve_in_the_Armed_Forces__c = 'No';       
        newApplications.Do_You_Currently_Have_Income__c = 'No';       
        newApplications.Do_You_Have_a_History_of_Substance_Abuse__c = 'None';       
        newApplications.Do_You_Have_a_Mental_Health_Diagnosis__c = 'No';       
        newApplications.Do_You_Have_a_Physical_Disorder__c = 'No';
  newApplications.Do_You_Work_With_a_Case_Manager_Program__c = 'No';
  newApplications.How_Did_You_Hear_About_the_Program__c = 'Agency Referral';       
        newApplications.Number_of_People_You_Financially_Support__c = '1';
  newApplications.What_is_Your_Housing_Status__c = 'Rent';
        newApplications.What_is_Your_Legal_History__c = 'None';
        insert newApplications;
        KFGCreateTrainingApplicationController controller=new KFGCreateTrainingApplicationController();
        controller.save();
     
    }   
   
}
Im a newbie...what i need to do seems simple enough but i can't seem to get it to work.  hoping someone can help me correct my errors.  i have the following controller and test class to insert a new record into a custom object.  when i run tests and review my controller their is no blue or red marking showing me what is covered... also, code coverage percentage shows zero so im pretty sure the test is not happening.  HELP!

CONTROLLER:
public class KFGCreateTrainingReferralController {

    public Referrals__c referrals {get; set;}
   
   // blank constructor
    public KFGCreateTrainingReferralController() {
  referrals = new Referrals__c();
    }

  // save button is clicked
    public PageReference save() {
        try {
            upsert(referrals); // inserts the new record into the database
        } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new referral.'));
      return null;
        }
       
    // if successfully inserted new application, then displays the thank you page.
    return Page.TrainingReferralThankYou;
    }
}

TEST:

@isTest
public with sharing class KFGCreateTrainingReferralControllerTest {
    //==================== TEST METHOD(s) ======================================
    static testMethod void KFGCreateTrainingReferralControllerTest() {
 Referrals__c newReferrals = new Referrals__c();
 // Test insert Referrals__c
        newReferrals.Referral_Date__c = Date.Today();
        newReferrals.Referrer_First_Name__c = 'TestFirstName';
        newReferrals.Referrer_Last_Name__c = 'TestLastName';
        newReferrals.Email__c = 'testreferrer@test.com';
        newReferrals.State__c = 'ca';
  insert newReferrals;
    }
}
I have two multiple picklists in the Contacts Object.  One for "Contact Type" and one for "Applicant Status".  I need a rule that says anytime Contact Type of "Training Applicant" is selected then Applicant Status must be completed.  When I check the syntax for the formula I created, the system tells me that there is a multiple pick list error and that multiple pick lists are only supported with certain functions.  I watched a salesforce video that proves the validation can be done although the demo used the Accounts object and not the Contacts Object; not sure if this makes a difference or not.  The video is at https://www.youtube.com/watch?v=5otBBMmDhyk). 

The formula I used is below but I also tried several other iterations to no avail.  Does anyone know if the validation cannot be created because it is in the Contacts Object?  Is it because I am using the Non-Profit Starter Pack?  Any ideas?  Workarounds?

ISPICKVAL (Contact Type, "Training Applicant")
&&
Text (Applicant Status) = ""
been at this for hours and can't seem to figure out why my test class  isn't covering the following controller code:     } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new application.'));
      return null;
        }.

i do have a few workflow rules that are active but the initial insert of a new record would not fire any of these off...would that have an impact?

Controller is
public class KFGCreateTrainingApplicationController {

    public Applications__c applications {get; set;}
   
   // blank constructor
    public KFGCreateTrainingApplicationController() {
  applications = new Applications__c();
    }

  // save button is clicked
    public PageReference save() {
        try {
            upsert(applications); // inserts the new record into the database
        } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new application.'));
      return null;
        }
       
    // if successfully inserted new application, then displays the thank you page.
    return Page.TrainingApplicationThankYou;
    }
}


Test Is:
@isTest
public with sharing class KFGCreateTrainingAppControllerTest {
    //==================== TEST METHOD(s) ======================================
    static testMethod void KFGCreateTrainingAppControllerTest() {
     
  Applications__c newApplications = new Applications__c();
   
        // Test insert Applications__c
        newApplications.Application_Date__c = Date.Today();
        newApplications.Online_Application__c = 'Yes';
        newApplications.Class_Number_Being_Applied_For__c = 1; 
        newApplications.Applicant_First_Name__c = 'TestFirstName';
        newApplications.Applicant_Last_Name__c = 'TestLastName';
        newApplications.Age__c = 24;
        newApplications.Gender__c = 'Female';
        newApplications.Race__c = 'Latino/Hispanic';
        newApplications.Email__c = 'testreferrer@test.com';
        newApplications.State__c = 'ca';
        newApplications.Are_You_A_Current_or_Former_Foster_Youth__c = 'Yes';
        newApplications.Are_You_a_Domestic_Violence_Victim__c = 'Yes';       
        newApplications.Did_You_Attend_College__c = 'No';
        newApplications.Did_You_Attend_High_School__c = 'No';       
        newApplications.Have_You_Had_Vocational_Training__c = 'No';
        newApplications.Did_You_Serve_in_the_Armed_Forces__c = 'No';       
        newApplications.Do_You_Currently_Have_Income__c = 'No';       
        newApplications.Do_You_Have_a_History_of_Substance_Abuse__c = 'None';       
        newApplications.Do_You_Have_a_Mental_Health_Diagnosis__c = 'No';       
        newApplications.Do_You_Have_a_Physical_Disorder__c = 'No';
  newApplications.Do_You_Work_With_a_Case_Manager_Program__c = 'No';
  newApplications.How_Did_You_Hear_About_the_Program__c = 'Agency Referral';       
        newApplications.Number_of_People_You_Financially_Support__c = '1';
  newApplications.What_is_Your_Housing_Status__c = 'Rent';
        newApplications.What_is_Your_Legal_History__c = 'None';
        insert newApplications;
        KFGCreateTrainingApplicationController controller=new KFGCreateTrainingApplicationController();
        controller.save();
     
    }   
   
}
Im a newbie...what i need to do seems simple enough but i can't seem to get it to work.  hoping someone can help me correct my errors.  i have the following controller and test class to insert a new record into a custom object.  when i run tests and review my controller their is no blue or red marking showing me what is covered... also, code coverage percentage shows zero so im pretty sure the test is not happening.  HELP!

CONTROLLER:
public class KFGCreateTrainingReferralController {

    public Referrals__c referrals {get; set;}
   
   // blank constructor
    public KFGCreateTrainingReferralController() {
  referrals = new Referrals__c();
    }

  // save button is clicked
    public PageReference save() {
        try {
            upsert(referrals); // inserts the new record into the database
        } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new referral.'));
      return null;
        }
       
    // if successfully inserted new application, then displays the thank you page.
    return Page.TrainingReferralThankYou;
    }
}

TEST:

@isTest
public with sharing class KFGCreateTrainingReferralControllerTest {
    //==================== TEST METHOD(s) ======================================
    static testMethod void KFGCreateTrainingReferralControllerTest() {
 Referrals__c newReferrals = new Referrals__c();
 // Test insert Referrals__c
        newReferrals.Referral_Date__c = Date.Today();
        newReferrals.Referrer_First_Name__c = 'TestFirstName';
        newReferrals.Referrer_Last_Name__c = 'TestLastName';
        newReferrals.Email__c = 'testreferrer@test.com';
        newReferrals.State__c = 'ca';
  insert newReferrals;
    }
}
I have two multiple picklists in the Contacts Object.  One for "Contact Type" and one for "Applicant Status".  I need a rule that says anytime Contact Type of "Training Applicant" is selected then Applicant Status must be completed.  When I check the syntax for the formula I created, the system tells me that there is a multiple pick list error and that multiple pick lists are only supported with certain functions.  I watched a salesforce video that proves the validation can be done although the demo used the Accounts object and not the Contacts Object; not sure if this makes a difference or not.  The video is at https://www.youtube.com/watch?v=5otBBMmDhyk). 

The formula I used is below but I also tried several other iterations to no avail.  Does anyone know if the validation cannot be created because it is in the Contacts Object?  Is it because I am using the Non-Profit Starter Pack?  Any ideas?  Workarounds?

ISPICKVAL (Contact Type, "Training Applicant")
&&
Text (Applicant Status) = ""