• Michael M
  • SMARTIE
  • 1425 Points
  • Member since 2019

  • Chatter
    Feed
  • 1
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 165
    Questions
  • 333
    Replies
This code doesnt work.



trigger CreateCase on Contact (before insert) {
 
    List<Case> listCase = new List<Case>();
     for(Contact a : Trigger.New) {  
          listCase.add(new Case(
          AccountID=a.AccountID,        
          ContactID = a.Name,
          Priority ='High',
          Origin = 'Phone',
          Status = 'Working')); 
          }
       
     if(listCase.size() > 0)
  {
        insert listCase;
    }
}
Anyone know what the issue is? 

My VF page is displaying fine for me (admin), but other users are seeing this on the page display:


Object type not accessible. Please check permissions and make sure the object is not in development mode: No such column 'Referral_Name__c' on entity 'Eligibility__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.. Original queryString was: 'SELECT Created_Date_formula__c, (SELECT Address_Number_and_Street__c, Anniversary_Date__c, City__c, Client_ID__c, County_formula__c, CS_Code10__c, CS_Code11__c, CS_Code12__c, CS_Code13__c, CS_Code14__c, CS_Code15__c, CS_Code16__c, CS_Code17__c, CS_Code18__c, CS_Code19__c, CS_Code1__c, CS_Code20__c, CS_Code2__c, CS_Code3__c, CS_Code4__c, CS_Code5__c, CS_Code6__c, CS_Code7__c, CS_Code8__c, CS_Code9__c, CS_Description10__c, CS_Description11__c, CS_Description12__c, CS_Description13__c, CS_Description14__c, CS_Description15__c, CS_Description16__c, CS_Description17__c, CS_Description18__c, CS_Description19__c, CS_Description1__c, CS_Description20__c, CS_Description2__c, CS_Description3__c, CS_Description4__c, CS_Description5__c, CS_Description6__c, CS_Description7__c, CS_Description8__c, CS_Description9__c, Date_of_Birth__c, Date_of_Service__c, eMeds_error_message__c, Exception_Code1__c, Exception_Code2__c, Exception_Code3__c, Exception_Code4__c, Exception_Code5__c, Gender_Formula__c, Id, Medicare_Identifier__c, Name_formula__c, NAMI_Amount__c, NAMI_Effective_Date__c, Office__c, Other_Payer1_Name__c, Other_Payer2_Name__c, Other_Payer3_Name__c, Other_Payer_Name__c, Plan__c, Plan_Address_2__c, Plan_Address_City__c, Plan_Address_Number_and_Street__c, Plan_Address_State__c, Plan_Address_Zip_Code__c, Plan_Code__c, Plan_Date__c, Plan_Name__c, Plan_Phone_Number__c, Provider1__c, Provider2__c, Provider3__c, Provider4__c, Provider5__c, Recertification_Month__c, State__c, Third_Party1_Address_2__c, Third_Party1_Address_Number_and_Street__c, Third_Party1_benefit_id__c, Third_Party1_City__c, Third_Party1_Group_Number__c, Third_Party1_Phone__c, Third_Party1_Policy_Number__c, Third_Party1_State__c, Third_Party1_Zip_Code__c, Third_Party2_Address_2__c, Third_Party2_Address_Number_and_Street__c, Third_Party2_benefit_id__c, Third_Party2_City__c, Third_Party2_Group_Number__c, Third_Party2_Phone__c, Third_Party2_Policy_Number__c, Third_Party2_State__c, Third_Party2_Zip_Code__c, Third_Party3_Address_2__c, Third_Party3_Address_Number_and_Street__c, Third_Party3_benefit_id__c, Third_Party3_City__c, Third_Party3_Group_Number__c, Third_Party3_Phone__c, Third_Party3_Policy_Number__c, Third_Party3_State__c, Third_Party3_Zip_Code__c, Zip_Code__c FROM Eligibilities__r), Id, Patient_SSN__c FROM Lead WHERE id = '00Q63000007eJqq''


Here is the VF page:
<apex:page standardController="Lead"  lightningStylesheets="true">

    
    <apex:stylesheet value="{!$Resource.emedCss}"/>  
  
    
<!-- Header section --> 
    <div>
        <div style = "float: left"> {!lead.Created_Date_formula__c} </div>
        <div style = "float: right; font-size: 14px; position: relative; padding-right:30%;"> eMeds Eligibility Response Details - Salesforce </div>
    </div>
    <br/>
    <apex:image id="theImage" value="{!$Resource.eMedSymbol}" width="500" height="45"/>
 <h2>
     Eligibility Response Details 
    </h2> 
<apex:pageBlock mode="maindetail">
  <apex:repeat value="{!Lead.Eligibilities__r}" var="ci">  
      <!-- Error Message -->
    <apex:outputPanel rendered="{!IF(ci.eMeds_error_message__c ='' || ci.eMeds_error_message__c = null,false,true)}">
        <h2 style = "background-color: #faed27 ;">
          {!ci.emeds_error_message__c}
        </h2>
      </apex:outputPanel>     
  <!-- Missing Fields Information  
    <apex:outputPanel rendered="{!IF(  lead.medicaid_id__c = null && lead.patient_ssn__c = null,false,true)}">
        <h2 style = "background-color: #faed27 ;">
          Medicaid ID and SSN fields are both empty. Please fill in one of them to make the callout. 
        </h2>
      </apex:outputPanel>   -->        

<!-- Client Information -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Client_ID__c ='' ||  ci.Client_ID__c = null ,false,true)}">           
<div class= "containerOfContainer">
    <div class="container">
 <h3>
     Client Information:
 </h3>
<div class="floatLeft">
    
<table>
  <tr>
    <th>Client ID:</th>
    <td>{!ci.Client_ID__c}</td>
  </tr>
  <tr>
    <th>Gender:</th>
    <td>{!ci.Gender_Formula__c}</td>
  </tr>
  <tr>
    <th>Date of Birth:</th>
    <td>{!ci.Date_of_Birth__c}</td>
  </tr>
  <tr>
    <th>Anniversary Date:</th>
    <td>{!ci.Anniversary_Date__c}</td>
  </tr>
  <tr>
    <th>Recertification:</th>
    <td>{!ci.Recertification_Month__c}</td>
  </tr>
  <tr>
    <th>County:</th>
    <td>{!ci.County_formula__c}</td>
  </tr>
  <tr>
    <th>Date of Service:</th>
    <td>{!ci.Date_of_Service__c}</td>
  </tr>    
   <tr>
    <th></th>
    <td></td>
  </tr>  
</table>
    <br/>
</div>

<div class="floatRight">
<table>
  <tr>
    <th>Client Name:</th>
    <td>{!ci.Name_formula__c}</td>
  </tr>
  <tr>
    <th>SSN:</th>
    <td>{!lead.patient_ssn__c}</td>
  </tr>
  <tr>
    <th>Address:</th>
    <td>{!ci.Address_Number_and_Street__c}</td>
  </tr>
  <tr>
  <!--  <th>Address 2:</th>
    <td></td>
  </tr>
  <tr> --> 
    <th>City, State Zip:</th>
    <td>{!ci.City__c}, {!ci.State__c}  {!ci.Zip_Code__c}</td>
  </tr>
  <tr>
    <th>Office:</th>
    <td>{!ci.Office__c}</td>
  </tr>
  <tr>
    <th>Plan Date:</th>
    <td>{!ci.Plan_Date__c}</td>
  </tr>        
</table>
    <br/>
</div>
</div>
</div>
</apex:outputPanel>
    <br/>
<!-- Medicaid Eligibility Information-->   
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.CS_Code1__c ='' ||  ci.CS_Code1__c = null ,false,true)}">       
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Medicaid Eligibility Information:
   </h3>            
   <h3 class="planName"> 
      {!ci.Plan__c}  
    </h3>
  <!-- NAMI -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.NAMI_Amount__c ='' ||  ci.NAMI_Amount__c = null ,false,true)}">        
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {!ci.NAMI_Amount__c}
    <br/>
 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {!ci.NAMI_Effective_Date__c}
    </apex:outputPanel>    
    <h4>
      Covered Services  
    </h4>
 <table  class="boxedInTable">
    <col style="width:15%"/>
    <col style="width:40%"/>  
     <tr>
     <th>Code</th>
     <th> Description</th>
     </tr>       
     <tr>
     <td>{!ci.CS_Code1__c}</td>
     <td>{!ci.CS_Description1__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code2__c}</td>
     <td>{!ci.CS_Description2__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code3__c}</td>
     <td>{!ci.CS_Description3__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code4__c}</td>
     <td>{!ci.CS_Description4__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code5__c}</td>
     <td>{!ci.CS_Description5__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code6__c}</td>
     <td>{!ci.CS_Description6__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code7__c}</td>
     <td>{!ci.CS_Description7__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code8__c}</td>
     <td>{!ci.CS_Description8__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code9__c}</td>
     <td>{!ci.CS_Description9__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code10__c}</td>
     <td>{!ci.CS_Description10__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code11__c}</td>
     <td>{!ci.CS_Description11__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code12__c}</td>
     <td>{!ci.CS_Description12__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code13__c}</td>
     <td>{!ci.CS_Description13__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code14__c}</td>
     <td>{!ci.CS_Description14__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code15__c}</td>
     <td>{!ci.CS_Description15__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code16__c}</td>
     <td>{!ci.CS_Description16__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code17__c}</td>
     <td>{!ci.CS_Description17__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code18__c}</td>
     <td>{!ci.CS_Description18__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code19__c}</td>
     <td>{!ci.CS_Description19__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code20__c}</td>
     <td>{!ci.CS_Description20__c}</td>
     </tr>     
 </table>
    <br/>
</div>
</div>   
    </apex:outputPanel>    
    <br/>
<!-- Medicaid Managed Care -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Plan_Name__c ='' ||  ci.Plan_Name__c = null ,false,true)}">           
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Medicaid Managed Care:
   </h3> 
<table class="boxedInTable">
  <tr>
    <th>Plan name:</th>
    <td>{!ci.Plan_Name__c}</td>
  </tr>
  <tr>
    <th>Address:</th>
      <td>{!ci.Plan_Address_Number_and_Street__c} {!ci.Plan_Address_2__c}, {!ci.Plan_Address_City__c} {!ci.Plan_Address_State__c} {!ci.Plan_Address_Zip_Code__c}</td>
  </tr>
  <tr>
    <th>Phone:</th>
    <td>{!ci.Plan_Phone_Number__c}</td>
  </tr>
  <tr>
    <th>Plan Code:</th>
    <td>{!ci.Plan_Code__c}</td>
  </tr>
</table>  
    <br/>
</div>
</div> 
    </apex:outputPanel>
    <br/>
    
<!-- Medicaid Exceptions -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Exception_Code1__c ='' ||  ci.Exception_Code1__c = null ,false,true)}">               
<div class= "containerOfContainer">
<div class="container">
   <h3>
       Medicaid Exceptions:
   </h3> 
 <table  class="boxedInTable">
    <col style="width:30%"/>
    <col style="width:40%"/> 
     <tr>
     <th colspan="2">Exception Code</th>
     <th style="padding-right:10px;" colspan="3">Provider</th>
     </tr>       
     <tr>
     <td>{!ci.Exception_Code1__c}</td>
     <td>{!ci.Provider1__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code2__c}</td>
     <td>{!ci.Provider2__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code3__c}</td>
     <td>{!ci.Provider3__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code4__c}</td>
     <td>{!ci.Provider4__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code5__c}</td>
     <td>{!ci.Provider5__c}</td>
     </tr>     
  </table>    
    <br/>
</div>
</div>
    </apex:outputPanel>    
    <br/> 
<!-- Medicare Information--> 
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Medicare_Identifier__c ='' ||  ci.Medicare_Identifier__c = null ,false,true)}">                   
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Medicare Information:
   </h3> 
<table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer_Name__c}</td>
  </tr>
  <tr>
    <th>Medicare Identifier:</th>
      <td>{!ci.Medicare_Identifier__c}</td>
  </tr>
</table>  
    <br/>
</div>
</div> 
    </apex:outputPanel>    
 <br/>    

<!-- Third Party Insurance -->   
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Other_Payer1_Name__c ='' ||  ci.Other_Payer1_Name__c = null ,false,true)}">        
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Third Party Insurance:
   </h3>        
<table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer1_Name__c}</td>
  </tr>
  <tr>
    <th>Carrier Code:</th>
      <td>{!ci.Third_Party1_benefit_id__c}</td>
  </tr>
 <tr>
    <th>Other Payer Address:</th>
    <td>{!ci.Third_Party1_Address_Number_and_Street__c} {!ci.Third_Party1_Address_2__c}, {!ci.Third_Party1_City__c} {!ci.Third_Party1_State__c} {!ci.Third_Party1_Zip_Code__c} </td>
  </tr>
  <tr>
    <th>Phone Number:</th>
      <td>{!ci.Third_Party1_Phone__c}</td>
  </tr>
 <tr>
    <th>Policy Number:</th>
    <td>{!ci.Third_Party1_Policy_Number__c}</td>
  </tr>   
 <tr>
    <th>Group Number:</th>
    <td>{!ci.Third_Party1_Group_Number__c}</td>
  </tr>     
</table>  
     
 <br/>  
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Other_Payer2_Name__c ='' ||  ci.Other_Payer2_Name__c = null ,false,true)}">    
 <table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer2_Name__c}</td>
  </tr>
  <tr>
    <th>Carrier Code:</th>
      <td>{!ci.Third_Party2_benefit_id__c}</td>
  </tr>
 <tr>
    <th>Other Payer Address:</th>
    <td>{!ci.Third_Party2_Address_Number_and_Street__c} {!ci.Third_Party2_Address_2__c}, {!ci.Third_Party2_City__c} {!ci.Third_Party2_State__c} {!ci.Third_Party2_Zip_Code__c} </td>
  </tr>
  <tr>
    <th>Phone Number:</th>
      <td>{!ci.Third_Party2_Phone__c}</td>
  </tr>
 <tr>
    <th>Policy Number:</th>
    <td>{!ci.Third_Party2_Policy_Number__c}</td>
  </tr>   
 <tr>
    <th>Group Number:</th>
    <td>{!ci.Third_Party2_Group_Number__c}</td>
  </tr>     
</table>        
 <br/>  
 </apex:outputPanel>    
 
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Other_Payer3_Name__c ='' ||  ci.Other_Payer3_Name__c = null ,false,true)}">       
 <table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer3_Name__c}</td>
  </tr>
  <tr>
    <th>Carrier Code:</th>
      <td>{!ci.Third_Party3_benefit_id__c}</td>
  </tr>
 <tr>
    <th>Other Payer Address:</th>
    <td>{!ci.Third_Party3_Address_Number_and_Street__c} {!ci.Third_Party3_Address_2__c}, {!ci.Third_Party3_City__c} {!ci.Third_Party3_State__c} {!ci.Third_Party3_Zip_Code__c} </td>
  </tr>
  <tr>
    <th>Phone Number:</th>
      <td>{!ci.Third_Party3_Phone__c}</td>
  </tr>
 <tr>
    <th>Policy Number:</th>
    <td>{!ci.Third_Party3_Policy_Number__c}</td>
  </tr>   
 <tr>
    <th>Group Number:</th>
    <td>{!ci.Third_Party3_Group_Number__c}</td>
  </tr>     
</table> 
    </apex:outputPanel>    
 </div>
</div>    
</apex:outputPanel>     
     </apex:repeat>     
    </apex:pageBlock> 

          
</apex:page>
Why am I getting this error: "Static method cannot be referenced from a non static context: void EMedCalloutsExtension.makePostCallout1(List<Id>)" ?

The error appears when I try to save this test class:
@isTest
private class EmedscalloutTest2 {
     @isTest static void testCallout() {
         date d = date.today();
         lead l = new lead(firstname = 'test', lastname = 'test', patient_dob__c = d);
         insert l;
         list<string> refids = new list<string>();
         refids.add(l.id);
         
        // Set mock callout class 
        Test.setMock(HttpCalloutMock.class, new EmedsCalloutTest());
        
        // Call method to test.
        // This causes a fake response to be sent
        // from the class that implements HttpCalloutMock. 
        EMedCalloutsExtension tw = new EMedCalloutsExtension();
        tw.makePostCallout1(refids);

    }
}


Here is my first test class/method:
@isTest
global class EmedsCalloutTest implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest req) {
        // Optionally, only send a mock response for a specific endpoint
        // and method.
        System.assertEquals('http://example.com/example/test', req.getEndpoint());
        System.assertEquals('GET', req.getMethod());
        
        // Create a fake response
        HttpResponse res = new HttpResponse();
        res.setHeader('Content-Type', 'application/json');
        res.setBody('{"example":"test"}');
        res.setStatusCode(200);
        return res;
    }
}


and my actual code:
trigger  ReferralCreateContact on Lead (after insert, after update) {
if(!Test.isRunningTest()) { 
    if (trigger.isInsert){
     List<string> leadIds = new List<string>();
    for (lead ref : trigger.new){
      if(System.IsBatch() == false && System.isFuture() == false){ 
        if (ref.Epaces_Checked__c != true){
          lead newl = new lead();
          newl.Id = ref.id;
          leadIds.add(newl.id);
        EMedCalloutsExtension.makePostCallout1(leadIds); 
        }
      }}} }
public class EMedCalloutsExtension {
    static string EmedrequestId;
    static string requestStatus;
    
@future(callout = true)
public static void  makePostCallout1(list<id> refIds) {
    
  List <Lead> refs =[Select Id, firstname, lastname, gender__c, patient_dob__c, patient_ssn__c, Epaces_Checked__c, Emed_Request_Id__c, medicaid_id__c, medicare_id__c from Lead where Id in :refIds]; 
     List<lead> refToUpdate = new List<Lead>();      
           for (lead ref : refs){

 //Set up reassignment of static resource string items              
   String ssnReplace; 
           if (ref.Patient_SSN__c != null){
            ssnReplace = ref.Patient_SSN__c.replace('-','');
           }
    String genderLetter;
           if (ref.Gender__c == 'Male'){
               genderLetter = 'M';
           } else if (ref.Gender__c == 'Female'){
               genderLetter = 'F';
           }
           
           String first;
           String second;
           String third;
            String d = String.valueOf(ref.Patient_DOB__c);
           system.debug('***dob string raw: ' + d);
                first = d.substring(0,4);
                second = d.substring(5,7);
                third = d.substring(8,10);
           String dob = first + second + third;
           system.debug('***dob formatted: ' + dob);

 
//REQUEST #1          
      string reqbody;
     StaticResource r =[Select Id,Body from StaticResource where Name='EMedCalloutBody' limit 1];
      reqBody=r.body.toString(); 
     // reqBody=reqBody.replace('{{FirstName}}', ref.firstname);     
     // reqBody=reqBody.replace('{{LastName}}', ref.lastname);  
               if (ref.Medicaid_ID__c != null){
     // reqBody=reqBody.replace('{{MedicaidId}}', ref.medicaid_id__c); 
      reqBody = reqBody.replace('{{residentInfo}}', '{"first_name": "'+ ref.firstname +'", "last_name": "' + ref.lastname +'", "id_type":"MI", "subscriber_id":"' + ref.medicaid_id__c + '"}');             
               } 
               else if (ref.gender__c != null && ref.Patient_DOB__c != null && ref.Patient_SSN__c != null){
                   reqBody = reqBody.replace('{{residentInfo}}', '{"first_name": "'+ ref.firstname +'", "last_name": "' + ref.lastname +'", "gender":"' + genderLetter + '", "birthdate": "' + dob + '", "social_security_number": "' + ssnReplace + '"}');    
               }
       HttpRequest req = new HttpRequest();
           req.setHeader('Content-Type', 'application/json');
                req.setMethod('POST');
                req.setBody(reqBody);
                req.setEndpoint('callout:Emed');
                req.setTimeout(2 * 60 * 1000);
                    system.debug('ENDPOINT: ' + req.getendpoint());
                       system.debug('BODY: '+ req.getBody());
         Http http = new Http();
           HttpResponse response = http.send(req);
        if (response.getStatusCode() != 200) {
            System.debug('The status code returned was not expected: ' +
                response.getStatusCode() + ' ' + response.getStatus());
        } else {
            system.debug(response.getstatuscode());
           System.debug(response.getBody());
             string requestId = response.getbody().substringAfter('"request_id": ').substringBefore(',');
      //      ref.Emed_Request_Id__c = requestId;
            EmedrequestId = requestId;
            

              string reqbodyResp;   
              StaticResource r2 =[Select Id,Body from StaticResource where Name='EmedResponseBody' limit 1];
               reqbodyResp=r2.body.toString();
              reqbodyResp=reqbodyResp.replace('{{requestId}}', EmedrequestId);
               
               HttpRequest req2 = new HttpRequest();
                  req2.setHeader('Content-Type', 'application/json');
                req2.setMethod('POST');
                req2.setBody(reqbodyResp);
                req2.setEndpoint('callout:Emed_Response');
                req2.setTimeout(2 * 60 * 1000);
                        system.debug('ENDPOINT2: ' + req2.getendpoint());
                        system.debug('BODY2: '+ req2.getBody());
                  Http http2 = new Http();
                 HttpResponse response2 = http2.send(req2);
               
        if (response2.getStatusCode() != 200) {
            System.debug('The status code returned was not expected: ' +
                response2.getStatusCode() + ' ' + response2.getStatus());
        } else {
            system.debug(response2.getstatuscode());
           System.debug(response2.getBody());
            Id refId = ref.id;
            // instantiate a new instance of the Queueable class
            EmedFollowupCallout makeAnotherFollowUp = new EmedFollowupCallout(response2.getBody(), refId, requestId);
            // enqueue the job for processing
            ID jobID = System.enqueueJob(makeAnotherFollowUp);

           } 
 
        }
          return;
    } 
}
   
}


 
I need to embed youtube videos in my einstein bot. Can I use either of these prebuilt items and use them to include a youtube video in my bot?
1. https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000Ecs9zUAB
2. https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000Ed00FUAR
Hello, I have a task to send out an email with campaign results (number of clicks, number of times opened, etc) , 3 days after any campaign is sent. Is this possible and what would you recommend?
Hello, when we send emails from Salesforce, the receiver, when he opens up the email, sees the name and the email address.

For example:
John Smith<John.smith@aol.com>

Is there a way to remove the email address from the header display, so that the receiver simply sees "John Smith" and does not see "<John.smith@aol.com>"?
Hello, I have the below apex class that is to be used to schedule merging duplicates. How would I write a test class for this? thank you!


global class purgeClDupsSchedulable implements Schedulable{
global void execute(SchedulableContext SC) {
 //** Tweak your account selection ... aka where clause ..
List<AggregateResult> MyMergeList = [SELECT Count(ID) , first_name__c, last_name__c, referral_account__c
FROM Community_Lead__c 
WHERE from_lost_referral__c=TRUE
GROUP BY first_name__c, last_name__c, referral_account__c
HAVING Count(ID) > 1 
ORDER BY Count(ID) desc
LIMIT 2000];


For (AggregateResult Agm : MyMergeList){

   String firstName = string.valueOf(agm.get('first_name__c'));
    String lastName = string.valueOf(agm.get('last_name__c'));
    date dob = date.valueOf(agm.get('dob__c'));
   community_lead__c ToAccount = [Select id, first_name__c, last_name__c from community_lead__c 
                                  where first_name__c like :firstName and last_name__c like :lastName and dob__c = :dob and createddate= today limit 1];
   community_lead__c FromAccount = [Select id, first_name__c, last_name__c from community_lead__c 
                                    where Id != :ToAccount.Id and first_name__c like :firstName and last_name__c like :lastName and dob__c = :dob and createddate= today Limit 1];

   database.merge(ToAccount , FromAccount );
}
}
}

 
Hello, I have a task to create a bit of a complicated report, and I am wondering if and how this is possible. 

The background is that our Lead object's "Status" picklist field has 2 values (for the purposes of this report) : "Accepted" and "Pending Opportunity". 

We want a report that contains data based on the following criteria:
- All Leads WHERE 1) the status was at any point in their history "Accepted" , and 2) the lead was converted into an opporunity, and 3) that opportunity''s stage became closed-won. 

Is this possible to do, and if so, how? (In case this is helpful, our Leads are connected to our Opportunities in the sense that both Leads and Opportunities have a lookup to the same Account)

If a formal "report" is not supported, can this be done with SOQL queries? 
Hello, I have a task to display a video when a user clicks on one of the options in our chatbot menu. Is there somewhere that provdies step by step instructions how to accomplish this?
Hello, I am setting up my first einstein bot... We have a dialogue that presents a menu. When the user clicks on one of the menu items (also a dialogue) we want it to automatically redirect the user to a new webpage. How can I build this into the bot/dialogue?
Hello I have a task to integrate our SF org with this website: https://www.nsopw.gov/ , in which you can simply search somebody's name and find out of whether or not they are a sex offender. We would just want to pass the first and last name of some of our records in SF. Is this possible, and how is the best way to do it? Has anyone done something similar?
Hello, I have a snippet of JSON that looks like this:
"dates": [
{
"name": "Service",
"qualifier": "472",
"date": "2020-09-29"
},
{
"name": "Plan Begin",
"qualifier": "346",
"date": "2020-09-01"
},
{
"name": "Issue",
"qualifier": "102",
"date": "2020-06-01"
}
],

I need to be able to get the values from each "object" individually. 
I am getting the list like this:

Map<String, Object> wholeResponse = (Map<String, Object>) JSON.deserializeUntyped(response2.getBody());
Map<String, Object> result = (Map<String, Object>) wholeResponse.get('result');
List<Object> lstdates = (List<Object>) result.get('dates');

But after that I am getting stuck. How would I be able to get the name, qualifier, and date from each object contained in this list? (This may be a basic question, but I am a newbie to json parsing:))
 
I am parsing JSON that is coming back from  REST callout, and when running, it is throwing this error: attempt to de-reference null object. The issue seems to be with how I am parsing the JSON, but I am not sure where I am going wrong. Can someone help?

Here is the snippet of the JSON I am parsing:
"result": {
"first_name": "JOHN",
"last_name": "SMITH",
"id_type": "MI",
"subscriber_id": "1234567",
"gender": "M",
"birthdate": "19601119",
"address": {
"info": "123 Main St.",
"city": "New York",
"state": "NY",
"zip_code": "100000"
},
"county:": {
"value": "14"
},
"office": {
"value": "H78"
},
"recert_month": {
"value": "12",
"name": "December"
},
"dates": [
{
"name": "Service",
"qualifier": "472",
"date": "2020-09-29"
},
{
"name": "Plan Begin",
"qualifier": "346",
"date": "2020-09-01"
},
{
"name": "Issue",
"qualifier": "102",
"date": "2020-06-01"
}
],


Here is how I am parsing it (bold part is causing error):
  
        Map<String, Object> wholeResponse = (Map<String, Object>) JSON.deserializeUntyped(response2.getBody());
            Map<String, Object> result = (Map<String, Object>) wholeResponse.get('result');
                Map<String, Object> residentAddress = (Map<String, Object>) result.get('address');
                   Map<String, Object> county = (Map<String, Object>) result.get('county');
                  Map<String, Object> office = (Map<String, Object>) result.get('office');
                 Map<String, Object> recert_month = (Map<String, Object>) result.get('recert_month');
        
       Eligibility__c newEligRec = new Eligibility__c(); 
        newEligRec.Referral_Name__c = ref.id;
        newEligRec.First_Name__c = string.valueof(result.get('first_name'));
        newEligRec.Last_Name__c = string.valueof(result.get('last_name'));
        newEligRec.Name_Id_Type__c = string.valueof(result.get('id_type'));
        newEligRec.Client_ID__c = string.valueOf(result.get('subscriber_id'));
        newEligRec.Gender__c = string.valueOf(result.get('gender'));
        string birthdate;
              if (string.valueof(result.get('birthdate')) != null){
                  birthdate = string.valueof(result.get('birthdate')).remove('-');
                  string year = birthdate.substring(0,4);
                  string month = birthdate.substring(4,6);
                  string day = birthdate.substring(6,8);
                 birthdate = month + '/' + day + '/' + year;
                    }
        newEligRec.Date_of_Birth__c = birthdate;
        newEligRec.Address_Number_and_Street__c = string.valueOf(residentAddress.get('info')); 
        newEligRec.City__c =  string.valueOf(residentAddress.get('city'));    
        newEligRec.State__c =  string.valueOf(residentAddress.get('state'));    
        newEligRec.Zip_Code__c = string.valueOf(residentAddress.get('zip_code'));
        newEligRec.County__c = string.valueOf(county.get('value'));
        newEligRec.Office__c = string.valueOf(office.get('value'));
        newEligRec.Recertification_Month_value__c = string.valueOf(recert_month.get('value'));
        newEligRec.Recertification_Month__c = string.valueOf(recert_month.get('name'));
Hello, I am parsing JSON that is coming back from  REST callout, and when running, it is throwing this error: attemp to de-reference null object. The issue seems to be with how I am parsing the JSON, but I am not sure where I am going wrong. Can someone help?

Here is the snippet of the JSON I am parsing (bold parts are those that are causing the error):
"result": {
"first_name": "JOHN",
"last_name": "SMITH",
"id_type": "MI",
"subscriber_id": "1234567",
"gender": "M",
"birthdate": "19601119",
"address": {
"info": "123 Main St.",
"city": "New York",
"state": "NY",
"zip_code": "100000"
},
"county:": {
"value": "14"
},
"office": {
"value": "H78"
},
"recert_month": {
"value": "12",
"name": "December"
},

"dates": [
{
"name": "Service",
"qualifier": "472",
"date": "2020-09-29"
},
{
"name": "Plan Begin",
"qualifier": "346",
"date": "2020-09-01"
},
{
"name": "Issue",
"qualifier": "102",
"date": "2020-06-01"
}
],


Here is how I am parsing it (bold part is causing error):
  
        Map<String, Object> wholeResponse = (Map<String, Object>) JSON.deserializeUntyped(response2.getBody());
            Map<String, Object> result = (Map<String, Object>) wholeResponse.get('result');
                Map<String, Object> residentAddress = (Map<String, Object>) result.get('address');
                   Map<String, Object> county = (Map<String, Object>) result.get('county');
                  Map<String, Object> office = (Map<String, Object>) result.get('office');
                 Map<String, Object> recert_month = (Map<String, Object>) result.get('recert_month');
        
       Eligibility__c newEligRec = new Eligibility__c(); 
        newEligRec.Referral_Name__c = ref.id;
        newEligRec.First_Name__c = string.valueof(result.get('first_name'));
        newEligRec.Last_Name__c = string.valueof(result.get('last_name'));
        newEligRec.Name_Id_Type__c = string.valueof(result.get('id_type'));
        newEligRec.Client_ID__c = string.valueOf(result.get('subscriber_id'));
        newEligRec.Gender__c = string.valueOf(result.get('gender'));
        string birthdate;
              if (string.valueof(result.get('birthdate')) != null){
                  birthdate = string.valueof(result.get('birthdate')).remove('-');
                  string year = birthdate.substring(0,4);
                  string month = birthdate.substring(4,6);
                  string day = birthdate.substring(6,8);
                 birthdate = month + '/' + day + '/' + year;
                    }
        newEligRec.Date_of_Birth__c = birthdate;
        newEligRec.Address_Number_and_Street__c = string.valueOf(residentAddress.get('info')); 
        newEligRec.City__c =  string.valueOf(residentAddress.get('city'));    
        newEligRec.State__c =  string.valueOf(residentAddress.get('state'));    
        newEligRec.Zip_Code__c = string.valueOf(residentAddress.get('zip_code'));
        newEligRec.County__c = string.valueOf(county.get('value'));
        newEligRec.Office__c = string.valueOf(office.get('value'));
        newEligRec.Recertification_Month_value__c = string.valueOf(recert_month.get('value'));

        newEligRec.Recertification_Month__c = string.valueOf(recert_month.get('name'));


- Also, as a bonus, how would I go about parsing the "dates" list from the JSON? Thank you very much for any help you can provide. 
Hello,
I need to fitler a report by where the created date of the record was on a Saturday or Sunday. How can I create such a field/formula? Thank you!
Is it possible to call a queueable apex class from a trigger? Asking because I need to pass my lead id in there... Can you please provide a simple example.. 
Hello, I am well aware that there is an issue with using SLDS together with renderas=pdf in a VF page. However I basically need to make this work. Does anyone have an idea for a workaround for how to make this work? I am open to any suggestions!
Is it possible to set up or get an API for my salesforce org so that other developers can make GET requests to pull data from Salesforce? 
Hello, I have a VF with lightningstylesheets = "true". (This needs to stay this way-- when I take that away the whole page doesn't look right.) I need to save this VF page as a PDF to my Lead record, from an after update trigger. 

I am seeing that I cannot use renderas="pdf" together with lightningstylesheets="true". 

I am also seeing that when I try to save the page as is as a pdf, it does not work-- the logs say Internal Salesforce.com Error. 

Does anyone have experience with a similar issue? How can I make this work? 

Here is the code I'm using to attach the page (called from a trigger)

@future(callout = true)
public static void generatePdf(Id leadId){
     PageReference pref = Page.SEEK_MVP_PDF_Display;
        pref.getParameters().put('id',leadId);  
        Blob b;
if(Test.isRunningTest()) {
  b = blob.valueOf('Unit.Test');
} else {
   b = pref.getContentaspdf(); 
}
        ContentVersion cv = new ContentVersion();
        cv.versionData = b;
        cv.title = 'SEEK Medicare Eligibility Check';
        cv.PathOnClient = 'SEEK_Eligibility_Check.pdf';
        insert cv;
    
        ContentVersion Content = [SELECT id, ContentDocumentId FROM ContentVersion where Id = :cv.Id];
        ContentDocumentLink contentlink=new ContentDocumentLink();
        contentlink.LinkedEntityId= leadId;
        contentlink.ShareType= 'V';
        contentlink.ContentDocumentId= Content.ContentDocumentId;
        insert contentlink; 

 
Hello, I need to render a row of my table conditionally. However the "rendered" tag is not working. I don't want to use <apex:outputPanel> around the row, because then it breaks up the table and makes extra spacing that doesn't look nice. Is there a way to get this to work in the <tr> tag itself?

 <table >
 <tr rendered="{!IF(spellFromDate2 ='',false,true)}">
             <th>SPELL</th>
            <th>{!spellFromDate2}</th>
          <th>{!spellToDate2 }</th>
         <th>{!spellHospFullDays2 }</th>
         <th>{!spellHospCoinsDays2 }</th>
         <th>{!snfFullDays2 }</th>
            <th>{!snfCoinsDays2 }</th>
          <th style="border-left: 1px solid black;"></th>
         <th></th>
         <th></th>
      </tr> 

  <tr>
             <th>SPELL</th>
            <th>{!spellFromDate3}</th>
          <th>{!spellToDate3 }</th>
         <th>{!spellHospFullDays3 }</th>
         <th>{!spellHospCoinsDays3 }</th>
         <th>{!snfFullDays3 }</th>
            <th>{!snfCoinsDays3 }</th>
          <th style="border-left: 1px solid black;"></th>
         <th></th>
         <th></th>
      </tr> 
</table>

I need to do some date manipulation in Apex, as follows. I need to take today's date, get the 1st day of the  month (so for today, 9/1/20), and I need to return 4 months from that date (in this case, 1/1/21). 
So:
1. Get the first of THIS month
2. Get that date  + 4 months

Is there a way to do this with apex?

Hello, I am setting up my first einstein bot... We have a dialogue that presents a menu. When the user clicks on one of the menu items (also a dialogue) we want it to automatically redirect the user to a new webpage. How can I build this into the bot/dialogue?
I am parsing JSON that is coming back from  REST callout, and when running, it is throwing this error: attempt to de-reference null object. The issue seems to be with how I am parsing the JSON, but I am not sure where I am going wrong. Can someone help?

Here is the snippet of the JSON I am parsing:
"result": {
"first_name": "JOHN",
"last_name": "SMITH",
"id_type": "MI",
"subscriber_id": "1234567",
"gender": "M",
"birthdate": "19601119",
"address": {
"info": "123 Main St.",
"city": "New York",
"state": "NY",
"zip_code": "100000"
},
"county:": {
"value": "14"
},
"office": {
"value": "H78"
},
"recert_month": {
"value": "12",
"name": "December"
},
"dates": [
{
"name": "Service",
"qualifier": "472",
"date": "2020-09-29"
},
{
"name": "Plan Begin",
"qualifier": "346",
"date": "2020-09-01"
},
{
"name": "Issue",
"qualifier": "102",
"date": "2020-06-01"
}
],


Here is how I am parsing it (bold part is causing error):
  
        Map<String, Object> wholeResponse = (Map<String, Object>) JSON.deserializeUntyped(response2.getBody());
            Map<String, Object> result = (Map<String, Object>) wholeResponse.get('result');
                Map<String, Object> residentAddress = (Map<String, Object>) result.get('address');
                   Map<String, Object> county = (Map<String, Object>) result.get('county');
                  Map<String, Object> office = (Map<String, Object>) result.get('office');
                 Map<String, Object> recert_month = (Map<String, Object>) result.get('recert_month');
        
       Eligibility__c newEligRec = new Eligibility__c(); 
        newEligRec.Referral_Name__c = ref.id;
        newEligRec.First_Name__c = string.valueof(result.get('first_name'));
        newEligRec.Last_Name__c = string.valueof(result.get('last_name'));
        newEligRec.Name_Id_Type__c = string.valueof(result.get('id_type'));
        newEligRec.Client_ID__c = string.valueOf(result.get('subscriber_id'));
        newEligRec.Gender__c = string.valueOf(result.get('gender'));
        string birthdate;
              if (string.valueof(result.get('birthdate')) != null){
                  birthdate = string.valueof(result.get('birthdate')).remove('-');
                  string year = birthdate.substring(0,4);
                  string month = birthdate.substring(4,6);
                  string day = birthdate.substring(6,8);
                 birthdate = month + '/' + day + '/' + year;
                    }
        newEligRec.Date_of_Birth__c = birthdate;
        newEligRec.Address_Number_and_Street__c = string.valueOf(residentAddress.get('info')); 
        newEligRec.City__c =  string.valueOf(residentAddress.get('city'));    
        newEligRec.State__c =  string.valueOf(residentAddress.get('state'));    
        newEligRec.Zip_Code__c = string.valueOf(residentAddress.get('zip_code'));
        newEligRec.County__c = string.valueOf(county.get('value'));
        newEligRec.Office__c = string.valueOf(office.get('value'));
        newEligRec.Recertification_Month_value__c = string.valueOf(recert_month.get('value'));
        newEligRec.Recertification_Month__c = string.valueOf(recert_month.get('name'));
Hello, Would someone be able to assist in writing a test class for the following apex class:
global class purgeFiles implements Schedulable{
    
    global void execute(SchedulableContext SC) {
        
    List<ContentDocumentLink > docs;
        docs = [SELECT Id, Linkedentity.name, Linkedentity.id,ContentDocument.CreatedDate  
                FROM contentDocumentLink 
                WHERE Linkedentityid 
                IN (SELECT Id FROM lead where createddate < Last_N_Days:7 and isconverted = false) ];  
                //may want to change to include ALL leads
                //AND ContentDocument.CreatedDate < Last_N_Days:7];
                if(!docs.isEmpty())
            delete docs;
    }
}

Thank you very much
When I try to drag my VF page to the lightning record page, and try to save, it gives this error: "Component 'Visualforce' has an invalid value for property 'Visualforce Page Name'."  What is the problem?
Anyone know what the issue is? 

My VF page is displaying fine for me (admin), but other users are seeing this on the page display:


Object type not accessible. Please check permissions and make sure the object is not in development mode: No such column 'Referral_Name__c' on entity 'Eligibility__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.. Original queryString was: 'SELECT Created_Date_formula__c, (SELECT Address_Number_and_Street__c, Anniversary_Date__c, City__c, Client_ID__c, County_formula__c, CS_Code10__c, CS_Code11__c, CS_Code12__c, CS_Code13__c, CS_Code14__c, CS_Code15__c, CS_Code16__c, CS_Code17__c, CS_Code18__c, CS_Code19__c, CS_Code1__c, CS_Code20__c, CS_Code2__c, CS_Code3__c, CS_Code4__c, CS_Code5__c, CS_Code6__c, CS_Code7__c, CS_Code8__c, CS_Code9__c, CS_Description10__c, CS_Description11__c, CS_Description12__c, CS_Description13__c, CS_Description14__c, CS_Description15__c, CS_Description16__c, CS_Description17__c, CS_Description18__c, CS_Description19__c, CS_Description1__c, CS_Description20__c, CS_Description2__c, CS_Description3__c, CS_Description4__c, CS_Description5__c, CS_Description6__c, CS_Description7__c, CS_Description8__c, CS_Description9__c, Date_of_Birth__c, Date_of_Service__c, eMeds_error_message__c, Exception_Code1__c, Exception_Code2__c, Exception_Code3__c, Exception_Code4__c, Exception_Code5__c, Gender_Formula__c, Id, Medicare_Identifier__c, Name_formula__c, NAMI_Amount__c, NAMI_Effective_Date__c, Office__c, Other_Payer1_Name__c, Other_Payer2_Name__c, Other_Payer3_Name__c, Other_Payer_Name__c, Plan__c, Plan_Address_2__c, Plan_Address_City__c, Plan_Address_Number_and_Street__c, Plan_Address_State__c, Plan_Address_Zip_Code__c, Plan_Code__c, Plan_Date__c, Plan_Name__c, Plan_Phone_Number__c, Provider1__c, Provider2__c, Provider3__c, Provider4__c, Provider5__c, Recertification_Month__c, State__c, Third_Party1_Address_2__c, Third_Party1_Address_Number_and_Street__c, Third_Party1_benefit_id__c, Third_Party1_City__c, Third_Party1_Group_Number__c, Third_Party1_Phone__c, Third_Party1_Policy_Number__c, Third_Party1_State__c, Third_Party1_Zip_Code__c, Third_Party2_Address_2__c, Third_Party2_Address_Number_and_Street__c, Third_Party2_benefit_id__c, Third_Party2_City__c, Third_Party2_Group_Number__c, Third_Party2_Phone__c, Third_Party2_Policy_Number__c, Third_Party2_State__c, Third_Party2_Zip_Code__c, Third_Party3_Address_2__c, Third_Party3_Address_Number_and_Street__c, Third_Party3_benefit_id__c, Third_Party3_City__c, Third_Party3_Group_Number__c, Third_Party3_Phone__c, Third_Party3_Policy_Number__c, Third_Party3_State__c, Third_Party3_Zip_Code__c, Zip_Code__c FROM Eligibilities__r), Id, Patient_SSN__c FROM Lead WHERE id = '00Q63000007eJqq''


Here is the VF page:
<apex:page standardController="Lead"  lightningStylesheets="true">

    
    <apex:stylesheet value="{!$Resource.emedCss}"/>  
  
    
<!-- Header section --> 
    <div>
        <div style = "float: left"> {!lead.Created_Date_formula__c} </div>
        <div style = "float: right; font-size: 14px; position: relative; padding-right:30%;"> eMeds Eligibility Response Details - Salesforce </div>
    </div>
    <br/>
    <apex:image id="theImage" value="{!$Resource.eMedSymbol}" width="500" height="45"/>
 <h2>
     Eligibility Response Details 
    </h2> 
<apex:pageBlock mode="maindetail">
  <apex:repeat value="{!Lead.Eligibilities__r}" var="ci">  
      <!-- Error Message -->
    <apex:outputPanel rendered="{!IF(ci.eMeds_error_message__c ='' || ci.eMeds_error_message__c = null,false,true)}">
        <h2 style = "background-color: #faed27 ;">
          {!ci.emeds_error_message__c}
        </h2>
      </apex:outputPanel>     
  <!-- Missing Fields Information  
    <apex:outputPanel rendered="{!IF(  lead.medicaid_id__c = null && lead.patient_ssn__c = null,false,true)}">
        <h2 style = "background-color: #faed27 ;">
          Medicaid ID and SSN fields are both empty. Please fill in one of them to make the callout. 
        </h2>
      </apex:outputPanel>   -->        

<!-- Client Information -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Client_ID__c ='' ||  ci.Client_ID__c = null ,false,true)}">           
<div class= "containerOfContainer">
    <div class="container">
 <h3>
     Client Information:
 </h3>
<div class="floatLeft">
    
<table>
  <tr>
    <th>Client ID:</th>
    <td>{!ci.Client_ID__c}</td>
  </tr>
  <tr>
    <th>Gender:</th>
    <td>{!ci.Gender_Formula__c}</td>
  </tr>
  <tr>
    <th>Date of Birth:</th>
    <td>{!ci.Date_of_Birth__c}</td>
  </tr>
  <tr>
    <th>Anniversary Date:</th>
    <td>{!ci.Anniversary_Date__c}</td>
  </tr>
  <tr>
    <th>Recertification:</th>
    <td>{!ci.Recertification_Month__c}</td>
  </tr>
  <tr>
    <th>County:</th>
    <td>{!ci.County_formula__c}</td>
  </tr>
  <tr>
    <th>Date of Service:</th>
    <td>{!ci.Date_of_Service__c}</td>
  </tr>    
   <tr>
    <th></th>
    <td></td>
  </tr>  
</table>
    <br/>
</div>

<div class="floatRight">
<table>
  <tr>
    <th>Client Name:</th>
    <td>{!ci.Name_formula__c}</td>
  </tr>
  <tr>
    <th>SSN:</th>
    <td>{!lead.patient_ssn__c}</td>
  </tr>
  <tr>
    <th>Address:</th>
    <td>{!ci.Address_Number_and_Street__c}</td>
  </tr>
  <tr>
  <!--  <th>Address 2:</th>
    <td></td>
  </tr>
  <tr> --> 
    <th>City, State Zip:</th>
    <td>{!ci.City__c}, {!ci.State__c}  {!ci.Zip_Code__c}</td>
  </tr>
  <tr>
    <th>Office:</th>
    <td>{!ci.Office__c}</td>
  </tr>
  <tr>
    <th>Plan Date:</th>
    <td>{!ci.Plan_Date__c}</td>
  </tr>        
</table>
    <br/>
</div>
</div>
</div>
</apex:outputPanel>
    <br/>
<!-- Medicaid Eligibility Information-->   
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.CS_Code1__c ='' ||  ci.CS_Code1__c = null ,false,true)}">       
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Medicaid Eligibility Information:
   </h3>            
   <h3 class="planName"> 
      {!ci.Plan__c}  
    </h3>
  <!-- NAMI -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.NAMI_Amount__c ='' ||  ci.NAMI_Amount__c = null ,false,true)}">        
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {!ci.NAMI_Amount__c}
    <br/>
 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {!ci.NAMI_Effective_Date__c}
    </apex:outputPanel>    
    <h4>
      Covered Services  
    </h4>
 <table  class="boxedInTable">
    <col style="width:15%"/>
    <col style="width:40%"/>  
     <tr>
     <th>Code</th>
     <th> Description</th>
     </tr>       
     <tr>
     <td>{!ci.CS_Code1__c}</td>
     <td>{!ci.CS_Description1__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code2__c}</td>
     <td>{!ci.CS_Description2__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code3__c}</td>
     <td>{!ci.CS_Description3__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code4__c}</td>
     <td>{!ci.CS_Description4__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code5__c}</td>
     <td>{!ci.CS_Description5__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code6__c}</td>
     <td>{!ci.CS_Description6__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code7__c}</td>
     <td>{!ci.CS_Description7__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code8__c}</td>
     <td>{!ci.CS_Description8__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code9__c}</td>
     <td>{!ci.CS_Description9__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code10__c}</td>
     <td>{!ci.CS_Description10__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code11__c}</td>
     <td>{!ci.CS_Description11__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code12__c}</td>
     <td>{!ci.CS_Description12__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code13__c}</td>
     <td>{!ci.CS_Description13__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code14__c}</td>
     <td>{!ci.CS_Description14__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code15__c}</td>
     <td>{!ci.CS_Description15__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code16__c}</td>
     <td>{!ci.CS_Description16__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code17__c}</td>
     <td>{!ci.CS_Description17__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code18__c}</td>
     <td>{!ci.CS_Description18__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code19__c}</td>
     <td>{!ci.CS_Description19__c}</td>
     </tr>
      <tr>
     <td>{!ci.CS_Code20__c}</td>
     <td>{!ci.CS_Description20__c}</td>
     </tr>     
 </table>
    <br/>
</div>
</div>   
    </apex:outputPanel>    
    <br/>
<!-- Medicaid Managed Care -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Plan_Name__c ='' ||  ci.Plan_Name__c = null ,false,true)}">           
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Medicaid Managed Care:
   </h3> 
<table class="boxedInTable">
  <tr>
    <th>Plan name:</th>
    <td>{!ci.Plan_Name__c}</td>
  </tr>
  <tr>
    <th>Address:</th>
      <td>{!ci.Plan_Address_Number_and_Street__c} {!ci.Plan_Address_2__c}, {!ci.Plan_Address_City__c} {!ci.Plan_Address_State__c} {!ci.Plan_Address_Zip_Code__c}</td>
  </tr>
  <tr>
    <th>Phone:</th>
    <td>{!ci.Plan_Phone_Number__c}</td>
  </tr>
  <tr>
    <th>Plan Code:</th>
    <td>{!ci.Plan_Code__c}</td>
  </tr>
</table>  
    <br/>
</div>
</div> 
    </apex:outputPanel>
    <br/>
    
<!-- Medicaid Exceptions -->
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Exception_Code1__c ='' ||  ci.Exception_Code1__c = null ,false,true)}">               
<div class= "containerOfContainer">
<div class="container">
   <h3>
       Medicaid Exceptions:
   </h3> 
 <table  class="boxedInTable">
    <col style="width:30%"/>
    <col style="width:40%"/> 
     <tr>
     <th colspan="2">Exception Code</th>
     <th style="padding-right:10px;" colspan="3">Provider</th>
     </tr>       
     <tr>
     <td>{!ci.Exception_Code1__c}</td>
     <td>{!ci.Provider1__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code2__c}</td>
     <td>{!ci.Provider2__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code3__c}</td>
     <td>{!ci.Provider3__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code4__c}</td>
     <td>{!ci.Provider4__c}</td>
     </tr>
     <tr>
     <td>{!ci.Exception_Code5__c}</td>
     <td>{!ci.Provider5__c}</td>
     </tr>     
  </table>    
    <br/>
</div>
</div>
    </apex:outputPanel>    
    <br/> 
<!-- Medicare Information--> 
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Medicare_Identifier__c ='' ||  ci.Medicare_Identifier__c = null ,false,true)}">                   
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Medicare Information:
   </h3> 
<table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer_Name__c}</td>
  </tr>
  <tr>
    <th>Medicare Identifier:</th>
      <td>{!ci.Medicare_Identifier__c}</td>
  </tr>
</table>  
    <br/>
</div>
</div> 
    </apex:outputPanel>    
 <br/>    

<!-- Third Party Insurance -->   
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Other_Payer1_Name__c ='' ||  ci.Other_Payer1_Name__c = null ,false,true)}">        
<div class= "containerOfContainer">
<div class="container">
   <h3>
     Third Party Insurance:
   </h3>        
<table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer1_Name__c}</td>
  </tr>
  <tr>
    <th>Carrier Code:</th>
      <td>{!ci.Third_Party1_benefit_id__c}</td>
  </tr>
 <tr>
    <th>Other Payer Address:</th>
    <td>{!ci.Third_Party1_Address_Number_and_Street__c} {!ci.Third_Party1_Address_2__c}, {!ci.Third_Party1_City__c} {!ci.Third_Party1_State__c} {!ci.Third_Party1_Zip_Code__c} </td>
  </tr>
  <tr>
    <th>Phone Number:</th>
      <td>{!ci.Third_Party1_Phone__c}</td>
  </tr>
 <tr>
    <th>Policy Number:</th>
    <td>{!ci.Third_Party1_Policy_Number__c}</td>
  </tr>   
 <tr>
    <th>Group Number:</th>
    <td>{!ci.Third_Party1_Group_Number__c}</td>
  </tr>     
</table>  
     
 <br/>  
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Other_Payer2_Name__c ='' ||  ci.Other_Payer2_Name__c = null ,false,true)}">    
 <table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer2_Name__c}</td>
  </tr>
  <tr>
    <th>Carrier Code:</th>
      <td>{!ci.Third_Party2_benefit_id__c}</td>
  </tr>
 <tr>
    <th>Other Payer Address:</th>
    <td>{!ci.Third_Party2_Address_Number_and_Street__c} {!ci.Third_Party2_Address_2__c}, {!ci.Third_Party2_City__c} {!ci.Third_Party2_State__c} {!ci.Third_Party2_Zip_Code__c} </td>
  </tr>
  <tr>
    <th>Phone Number:</th>
      <td>{!ci.Third_Party2_Phone__c}</td>
  </tr>
 <tr>
    <th>Policy Number:</th>
    <td>{!ci.Third_Party2_Policy_Number__c}</td>
  </tr>   
 <tr>
    <th>Group Number:</th>
    <td>{!ci.Third_Party2_Group_Number__c}</td>
  </tr>     
</table>        
 <br/>  
 </apex:outputPanel>    
 
<apex:outputPanel styleClass="boldHeader" rendered="{!IF(ci.Other_Payer3_Name__c ='' ||  ci.Other_Payer3_Name__c = null ,false,true)}">       
 <table style="padding-left: 3px;" class="boxedInTable">
  <tr>
    <th>Other Payer Name:</th>
    <td>{!ci.Other_Payer3_Name__c}</td>
  </tr>
  <tr>
    <th>Carrier Code:</th>
      <td>{!ci.Third_Party3_benefit_id__c}</td>
  </tr>
 <tr>
    <th>Other Payer Address:</th>
    <td>{!ci.Third_Party3_Address_Number_and_Street__c} {!ci.Third_Party3_Address_2__c}, {!ci.Third_Party3_City__c} {!ci.Third_Party3_State__c} {!ci.Third_Party3_Zip_Code__c} </td>
  </tr>
  <tr>
    <th>Phone Number:</th>
      <td>{!ci.Third_Party3_Phone__c}</td>
  </tr>
 <tr>
    <th>Policy Number:</th>
    <td>{!ci.Third_Party3_Policy_Number__c}</td>
  </tr>   
 <tr>
    <th>Group Number:</th>
    <td>{!ci.Third_Party3_Group_Number__c}</td>
  </tr>     
</table> 
    </apex:outputPanel>    
 </div>
</div>    
</apex:outputPanel>     
     </apex:repeat>     
    </apex:pageBlock> 

          
</apex:page>
Why am I getting this error: "Static method cannot be referenced from a non static context: void EMedCalloutsExtension.makePostCallout1(List<Id>)" ?

The error appears when I try to save this test class:
@isTest
private class EmedscalloutTest2 {
     @isTest static void testCallout() {
         date d = date.today();
         lead l = new lead(firstname = 'test', lastname = 'test', patient_dob__c = d);
         insert l;
         list<string> refids = new list<string>();
         refids.add(l.id);
         
        // Set mock callout class 
        Test.setMock(HttpCalloutMock.class, new EmedsCalloutTest());
        
        // Call method to test.
        // This causes a fake response to be sent
        // from the class that implements HttpCalloutMock. 
        EMedCalloutsExtension tw = new EMedCalloutsExtension();
        tw.makePostCallout1(refids);

    }
}


Here is my first test class/method:
@isTest
global class EmedsCalloutTest implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest req) {
        // Optionally, only send a mock response for a specific endpoint
        // and method.
        System.assertEquals('http://example.com/example/test', req.getEndpoint());
        System.assertEquals('GET', req.getMethod());
        
        // Create a fake response
        HttpResponse res = new HttpResponse();
        res.setHeader('Content-Type', 'application/json');
        res.setBody('{"example":"test"}');
        res.setStatusCode(200);
        return res;
    }
}


and my actual code:
trigger  ReferralCreateContact on Lead (after insert, after update) {
if(!Test.isRunningTest()) { 
    if (trigger.isInsert){
     List<string> leadIds = new List<string>();
    for (lead ref : trigger.new){
      if(System.IsBatch() == false && System.isFuture() == false){ 
        if (ref.Epaces_Checked__c != true){
          lead newl = new lead();
          newl.Id = ref.id;
          leadIds.add(newl.id);
        EMedCalloutsExtension.makePostCallout1(leadIds); 
        }
      }}} }
public class EMedCalloutsExtension {
    static string EmedrequestId;
    static string requestStatus;
    
@future(callout = true)
public static void  makePostCallout1(list<id> refIds) {
    
  List <Lead> refs =[Select Id, firstname, lastname, gender__c, patient_dob__c, patient_ssn__c, Epaces_Checked__c, Emed_Request_Id__c, medicaid_id__c, medicare_id__c from Lead where Id in :refIds]; 
     List<lead> refToUpdate = new List<Lead>();      
           for (lead ref : refs){

 //Set up reassignment of static resource string items              
   String ssnReplace; 
           if (ref.Patient_SSN__c != null){
            ssnReplace = ref.Patient_SSN__c.replace('-','');
           }
    String genderLetter;
           if (ref.Gender__c == 'Male'){
               genderLetter = 'M';
           } else if (ref.Gender__c == 'Female'){
               genderLetter = 'F';
           }
           
           String first;
           String second;
           String third;
            String d = String.valueOf(ref.Patient_DOB__c);
           system.debug('***dob string raw: ' + d);
                first = d.substring(0,4);
                second = d.substring(5,7);
                third = d.substring(8,10);
           String dob = first + second + third;
           system.debug('***dob formatted: ' + dob);

 
//REQUEST #1          
      string reqbody;
     StaticResource r =[Select Id,Body from StaticResource where Name='EMedCalloutBody' limit 1];
      reqBody=r.body.toString(); 
     // reqBody=reqBody.replace('{{FirstName}}', ref.firstname);     
     // reqBody=reqBody.replace('{{LastName}}', ref.lastname);  
               if (ref.Medicaid_ID__c != null){
     // reqBody=reqBody.replace('{{MedicaidId}}', ref.medicaid_id__c); 
      reqBody = reqBody.replace('{{residentInfo}}', '{"first_name": "'+ ref.firstname +'", "last_name": "' + ref.lastname +'", "id_type":"MI", "subscriber_id":"' + ref.medicaid_id__c + '"}');             
               } 
               else if (ref.gender__c != null && ref.Patient_DOB__c != null && ref.Patient_SSN__c != null){
                   reqBody = reqBody.replace('{{residentInfo}}', '{"first_name": "'+ ref.firstname +'", "last_name": "' + ref.lastname +'", "gender":"' + genderLetter + '", "birthdate": "' + dob + '", "social_security_number": "' + ssnReplace + '"}');    
               }
       HttpRequest req = new HttpRequest();
           req.setHeader('Content-Type', 'application/json');
                req.setMethod('POST');
                req.setBody(reqBody);
                req.setEndpoint('callout:Emed');
                req.setTimeout(2 * 60 * 1000);
                    system.debug('ENDPOINT: ' + req.getendpoint());
                       system.debug('BODY: '+ req.getBody());
         Http http = new Http();
           HttpResponse response = http.send(req);
        if (response.getStatusCode() != 200) {
            System.debug('The status code returned was not expected: ' +
                response.getStatusCode() + ' ' + response.getStatus());
        } else {
            system.debug(response.getstatuscode());
           System.debug(response.getBody());
             string requestId = response.getbody().substringAfter('"request_id": ').substringBefore(',');
      //      ref.Emed_Request_Id__c = requestId;
            EmedrequestId = requestId;
            

              string reqbodyResp;   
              StaticResource r2 =[Select Id,Body from StaticResource where Name='EmedResponseBody' limit 1];
               reqbodyResp=r2.body.toString();
              reqbodyResp=reqbodyResp.replace('{{requestId}}', EmedrequestId);
               
               HttpRequest req2 = new HttpRequest();
                  req2.setHeader('Content-Type', 'application/json');
                req2.setMethod('POST');
                req2.setBody(reqbodyResp);
                req2.setEndpoint('callout:Emed_Response');
                req2.setTimeout(2 * 60 * 1000);
                        system.debug('ENDPOINT2: ' + req2.getendpoint());
                        system.debug('BODY2: '+ req2.getBody());
                  Http http2 = new Http();
                 HttpResponse response2 = http2.send(req2);
               
        if (response2.getStatusCode() != 200) {
            System.debug('The status code returned was not expected: ' +
                response2.getStatusCode() + ' ' + response2.getStatus());
        } else {
            system.debug(response2.getstatuscode());
           System.debug(response2.getBody());
            Id refId = ref.id;
            // instantiate a new instance of the Queueable class
            EmedFollowupCallout makeAnotherFollowUp = new EmedFollowupCallout(response2.getBody(), refId, requestId);
            // enqueue the job for processing
            ID jobID = System.enqueueJob(makeAnotherFollowUp);

           } 
 
        }
          return;
    } 
}
   
}


 
Hello, I have a task to send out an email with campaign results (number of clicks, number of times opened, etc) , 3 days after any campaign is sent. Is this possible and what would you recommend?
Hello, when we send emails from Salesforce, the receiver, when he opens up the email, sees the name and the email address.

For example:
John Smith<John.smith@aol.com>

Is there a way to remove the email address from the header display, so that the receiver simply sees "John Smith" and does not see "<John.smith@aol.com>"?
Hello, I have the below apex class that is to be used to schedule merging duplicates. How would I write a test class for this? thank you!


global class purgeClDupsSchedulable implements Schedulable{
global void execute(SchedulableContext SC) {
 //** Tweak your account selection ... aka where clause ..
List<AggregateResult> MyMergeList = [SELECT Count(ID) , first_name__c, last_name__c, referral_account__c
FROM Community_Lead__c 
WHERE from_lost_referral__c=TRUE
GROUP BY first_name__c, last_name__c, referral_account__c
HAVING Count(ID) > 1 
ORDER BY Count(ID) desc
LIMIT 2000];


For (AggregateResult Agm : MyMergeList){

   String firstName = string.valueOf(agm.get('first_name__c'));
    String lastName = string.valueOf(agm.get('last_name__c'));
    date dob = date.valueOf(agm.get('dob__c'));
   community_lead__c ToAccount = [Select id, first_name__c, last_name__c from community_lead__c 
                                  where first_name__c like :firstName and last_name__c like :lastName and dob__c = :dob and createddate= today limit 1];
   community_lead__c FromAccount = [Select id, first_name__c, last_name__c from community_lead__c 
                                    where Id != :ToAccount.Id and first_name__c like :firstName and last_name__c like :lastName and dob__c = :dob and createddate= today Limit 1];

   database.merge(ToAccount , FromAccount );
}
}
}

 
Hello, I have a task to create a bit of a complicated report, and I am wondering if and how this is possible. 

The background is that our Lead object's "Status" picklist field has 2 values (for the purposes of this report) : "Accepted" and "Pending Opportunity". 

We want a report that contains data based on the following criteria:
- All Leads WHERE 1) the status was at any point in their history "Accepted" , and 2) the lead was converted into an opporunity, and 3) that opportunity''s stage became closed-won. 

Is this possible to do, and if so, how? (In case this is helpful, our Leads are connected to our Opportunities in the sense that both Leads and Opportunities have a lookup to the same Account)

If a formal "report" is not supported, can this be done with SOQL queries? 
Hello, I am setting up my first einstein bot... We have a dialogue that presents a menu. When the user clicks on one of the menu items (also a dialogue) we want it to automatically redirect the user to a new webpage. How can I build this into the bot/dialogue?
Hello I have a task to integrate our SF org with this website: https://www.nsopw.gov/ , in which you can simply search somebody's name and find out of whether or not they are a sex offender. We would just want to pass the first and last name of some of our records in SF. Is this possible, and how is the best way to do it? Has anyone done something similar?
Hello, I have a snippet of JSON that looks like this:
"dates": [
{
"name": "Service",
"qualifier": "472",
"date": "2020-09-29"
},
{
"name": "Plan Begin",
"qualifier": "346",
"date": "2020-09-01"
},
{
"name": "Issue",
"qualifier": "102",
"date": "2020-06-01"
}
],

I need to be able to get the values from each "object" individually. 
I am getting the list like this:

Map<String, Object> wholeResponse = (Map<String, Object>) JSON.deserializeUntyped(response2.getBody());
Map<String, Object> result = (Map<String, Object>) wholeResponse.get('result');
List<Object> lstdates = (List<Object>) result.get('dates');

But after that I am getting stuck. How would I be able to get the name, qualifier, and date from each object contained in this list? (This may be a basic question, but I am a newbie to json parsing:))
 
I am parsing JSON that is coming back from  REST callout, and when running, it is throwing this error: attempt to de-reference null object. The issue seems to be with how I am parsing the JSON, but I am not sure where I am going wrong. Can someone help?

Here is the snippet of the JSON I am parsing:
"result": {
"first_name": "JOHN",
"last_name": "SMITH",
"id_type": "MI",
"subscriber_id": "1234567",
"gender": "M",
"birthdate": "19601119",
"address": {
"info": "123 Main St.",
"city": "New York",
"state": "NY",
"zip_code": "100000"
},
"county:": {
"value": "14"
},
"office": {
"value": "H78"
},
"recert_month": {
"value": "12",
"name": "December"
},
"dates": [
{
"name": "Service",
"qualifier": "472",
"date": "2020-09-29"
},
{
"name": "Plan Begin",
"qualifier": "346",
"date": "2020-09-01"
},
{
"name": "Issue",
"qualifier": "102",
"date": "2020-06-01"
}
],


Here is how I am parsing it (bold part is causing error):
  
        Map<String, Object> wholeResponse = (Map<String, Object>) JSON.deserializeUntyped(response2.getBody());
            Map<String, Object> result = (Map<String, Object>) wholeResponse.get('result');
                Map<String, Object> residentAddress = (Map<String, Object>) result.get('address');
                   Map<String, Object> county = (Map<String, Object>) result.get('county');
                  Map<String, Object> office = (Map<String, Object>) result.get('office');
                 Map<String, Object> recert_month = (Map<String, Object>) result.get('recert_month');
        
       Eligibility__c newEligRec = new Eligibility__c(); 
        newEligRec.Referral_Name__c = ref.id;
        newEligRec.First_Name__c = string.valueof(result.get('first_name'));
        newEligRec.Last_Name__c = string.valueof(result.get('last_name'));
        newEligRec.Name_Id_Type__c = string.valueof(result.get('id_type'));
        newEligRec.Client_ID__c = string.valueOf(result.get('subscriber_id'));
        newEligRec.Gender__c = string.valueOf(result.get('gender'));
        string birthdate;
              if (string.valueof(result.get('birthdate')) != null){
                  birthdate = string.valueof(result.get('birthdate')).remove('-');
                  string year = birthdate.substring(0,4);
                  string month = birthdate.substring(4,6);
                  string day = birthdate.substring(6,8);
                 birthdate = month + '/' + day + '/' + year;
                    }
        newEligRec.Date_of_Birth__c = birthdate;
        newEligRec.Address_Number_and_Street__c = string.valueOf(residentAddress.get('info')); 
        newEligRec.City__c =  string.valueOf(residentAddress.get('city'));    
        newEligRec.State__c =  string.valueOf(residentAddress.get('state'));    
        newEligRec.Zip_Code__c = string.valueOf(residentAddress.get('zip_code'));
        newEligRec.County__c = string.valueOf(county.get('value'));
        newEligRec.Office__c = string.valueOf(office.get('value'));
        newEligRec.Recertification_Month_value__c = string.valueOf(recert_month.get('value'));
        newEligRec.Recertification_Month__c = string.valueOf(recert_month.get('name'));