function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alekhya Mathukumilli 7Alekhya Mathukumilli 7 

apex class does not load with these outputs

01type = eve.Consultation_Type__c;
02if(type=='Express')
03         {
04         for(Compliance_Checklist__c vio:[Selectid,Department__c,Checkbox_API__c,Notes_API__c,Category__c,Penalty__c,Sub_Category__c,Violation__c,Guidance_to_Avoid_Violation__cfrom Compliance_Checklist__c where EXPRESS__c=true]){
05                  violationMap.put(vio.id,vio);
06              }
07         }else
08 
09         {
10              for(Compliance_Checklist__c vio:[Selectid,Department__c,Checkbox_API__c,Notes_API__c,Category__c,Penalty__c,Sub_Category__c,Violation__c,Guidance_to_Avoid_Violation__cfrom Compliance_Checklist__c where CONSUMER__c=true or INFRASTRUCTURE__c=true]){
11                  violationMap.put(vio.id,vio);
12              }       
13         }

this is my present code. this query should return 67 records it does when I execute it as SOQL query but not on apex apge output.

my previous code is 
01if(type=='Consumer'){
02              for(Compliance_Checklist__c vio:[Selectid,Department__c,Checkbox_API__c,Notes_API__c,Category__c,Penalty__c,Sub_Category__c,Violation__c,Guidance_to_Avoid_Violation__cfrom Compliance_Checklist__c where CONSUMER__c=true]){
03                  violationMap.put(vio.id,vio);
04              }
05         }else if(type=='Express')
06         {
07         for(Compliance_Checklist__c vio:[Selectid,Department__c,Checkbox_API__c,Notes_API__c,Category__c,Penalty__c,Sub_Category__c,Violation__c,Guidance_to_Avoid_Violation__cfrom Compliance_Checklist__c where EXPRESS__c=true]){
08                  violationMap.put(vio.id,vio);
09              }
10         }else
11 
12         {
13              for(Compliance_Checklist__c vio:[Selectid,Department__c,Checkbox_API__c,Notes_API__c,Category__c,Penalty__c,Sub_Category__c,Violation__c,Guidance_to_Avoid_Violation__cfrom Compliance_Checklist__c where INFRASTRUCTURE__c=true]){
14                  violationMap.put(vio.id,vio);
15              }        
16         }


for some reason even if I change the values of type = Consultation_Type__c and try still this executes. My new code does not run still the old one executes.

is there anything I need to change along with the values of Consultation_Type__c ( this is a activity custom field)
Amit Singh 1Amit Singh 1
Hello,

Please check if the values for Consultation_Type__c custom fields are active and avialble for that profile.

Thanks!