• GordymanLG62
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I am at my wits end trying to get access to a custom settings object via Apex in a trigger and in a class.

 

Here's a simple class to get all the IDs from a custom settings object called ETO_LRT__c that has two fields Record_Type_Name__c and Record_Type_Id__c. I definitely have at least one dataset defined for this object.

 

When I try to access it via a utility class method, it always returns 0 values.

 

Here's the class

 

public class ETO_LeadUtils {

   public static Set<Id> ETO_AllRTs() {

   Set<Id> RTList = new Set<Id>();

   Map<String, ETO_LRT__c> CSMap= ETO_LRT__c.getAll();

   system.debug('Number of ETO LRTs = '+CSMap.size());

 

   for(String s : CSMap.keySet()){

    RTList.add(CSMap.get(s).Record_Type_Id__c);

   }

      return RTList;  }

 

 @isTest    public static void ETO_testAll(){

   ETO_LeadUtils.ETO_AllRTs();    }

}

 

What am I doing wrong?

 

 

I am at my wits end trying to get access to a custom settings object via Apex in a trigger and in a class.

 

Here's a simple class to get all the IDs from a custom settings object called ETO_LRT__c that has two fields Record_Type_Name__c and Record_Type_Id__c. I definitely have at least one dataset defined for this object.

 

When I try to access it via a utility class method, it always returns 0 values.

 

Here's the class

 

public class ETO_LeadUtils {

   public static Set<Id> ETO_AllRTs() {

   Set<Id> RTList = new Set<Id>();

   Map<String, ETO_LRT__c> CSMap= ETO_LRT__c.getAll();

   system.debug('Number of ETO LRTs = '+CSMap.size());

 

   for(String s : CSMap.keySet()){

    RTList.add(CSMap.get(s).Record_Type_Id__c);

   }

      return RTList;  }

 

 @isTest    public static void ETO_testAll(){

   ETO_LeadUtils.ETO_AllRTs();    }

}

 

What am I doing wrong?