• DrewK.ax1106
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

We were attempting to push some new changes through eclipse from sandbox to production which happened to be part of a object that contained a formula field that is used within a rollup.  Got the usual rollup field error about cross-object components on the fly functions. Debugged the formula field and found that the error was in the following, DATEVALUE(CreatedDate). We never had this issue when we originally rolled this out months ago but now its throwing an error.

 

CreatedDate is not cross-object or on the fly. Is this a bug or new changes that are not properly reflected in documentation?

Very new to Apex code, created the following class but I am having a miserable time creating a correct test class for it. Would anyone be able to help me out so I can go back over it and figure it out? Important to note I have already read multiple articles on test classes, just unable to master it.  Thanks.

 

 

 

 

 1  public with sharing class DisplaySectionsController {
 2   public List<Patient_Drugs__c> ptdrugs {get;set;}
 3   public String messages_equi {get;set;}
 4   public void load() {
 5   ptdrugs= [Select Name,Patient__c,Prescriber__c,Patient__r.Notes_from_HC__c,Drug__r.Name,Prescriber__r.Name,Patient__r.Patient_Health_Center__r.Name,Patient__r.Name,Patient__r.Date_of_Birth__c,Patient__r.Center_EMR_Patient_ID_Pt_Act__c,Patient__r.Residence_Phone__c From Patient_Drugs__c WHERE Patient__c=:ApexPages.currentPage().getParameters().get('id') and Rx_Request_Send_To__c = 'Prescriber' AND Rx_Received_Date__c=null order by Prescriber__c];
 6   if(ptdrugs.Size()==0)
 7   {
 8   messages_equi='EQ';
 9  
 10  
 11   }
 12   }
 13   public List<SelectOption> getP() {
 14   Map<String,selectOption> third1 = new Map<String,selectOption>();
 15   List<SelectOption> options= new List<SelectOption>();
 16  
 17   for (Patient_Drugs__c pd : [SELECT Prescriber__c,Prescriber__r.Name FROM Patient_Drugs__c WHERE Patient__c=:ApexPages.currentPage().getParameters().get('id') and Prescriber__r.Name<>'' and Rx_Request_Send_To__c = 'Prescriber' AND Rx_Received_Date__c=null order by Prescriber__r.Name])
 18   {
 19  
 20   if(pd.Prescriber__r.Name!= null)
 21   {
 22  
 23   third1.put('',new selectOption('', '-- None --'));
 24   third1.put(pd.Prescriber__r.Name,new selectOption(pd.Prescriber__c,pd.Prescriber__r.Name));
 25  
 26   }
 27  
 28   }
 29  
 30   options= third1.values();
 31   return options;
 32   }
 33  
 34  
 35  }

Any ideas on how to fix this? Thanks.

 

Save error: Unable to perform save on all files: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor    **** line 1    Force.com save problem


Very new to Apex code, created the following class but I am having a miserable time creating a correct test class for it. Would anyone be able to help me out so I can go back over it and figure it out? Important to note I have already read multiple articles on test classes, just unable to master it.  Thanks.

 

 

 

 

 1  public with sharing class DisplaySectionsController {
 2   public List<Patient_Drugs__c> ptdrugs {get;set;}
 3   public String messages_equi {get;set;}
 4   public void load() {
 5   ptdrugs= [Select Name,Patient__c,Prescriber__c,Patient__r.Notes_from_HC__c,Drug__r.Name,Prescriber__r.Name,Patient__r.Patient_Health_Center__r.Name,Patient__r.Name,Patient__r.Date_of_Birth__c,Patient__r.Center_EMR_Patient_ID_Pt_Act__c,Patient__r.Residence_Phone__c From Patient_Drugs__c WHERE Patient__c=:ApexPages.currentPage().getParameters().get('id') and Rx_Request_Send_To__c = 'Prescriber' AND Rx_Received_Date__c=null order by Prescriber__c];
 6   if(ptdrugs.Size()==0)
 7   {
 8   messages_equi='EQ';
 9  
 10  
 11   }
 12   }
 13   public List<SelectOption> getP() {
 14   Map<String,selectOption> third1 = new Map<String,selectOption>();
 15   List<SelectOption> options= new List<SelectOption>();
 16  
 17   for (Patient_Drugs__c pd : [SELECT Prescriber__c,Prescriber__r.Name FROM Patient_Drugs__c WHERE Patient__c=:ApexPages.currentPage().getParameters().get('id') and Prescriber__r.Name<>'' and Rx_Request_Send_To__c = 'Prescriber' AND Rx_Received_Date__c=null order by Prescriber__r.Name])
 18   {
 19  
 20   if(pd.Prescriber__r.Name!= null)
 21   {
 22  
 23   third1.put('',new selectOption('', '-- None --'));
 24   third1.put(pd.Prescriber__r.Name,new selectOption(pd.Prescriber__c,pd.Prescriber__r.Name));
 25  
 26   }
 27  
 28   }
 29  
 30   options= third1.values();
 31   return options;
 32   }
 33  
 34  
 35  }