• rob1961
  • NEWBIE
  • 0 Points
  • Member since 2009

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

We have a trigger that does some basic geographic cleansing (e.g., mapping country abbreviation "US" to international territory "AMER", mapping U.S.A to US, etc.).

 

The trigger relies on a utility class that initializes a set of lookup tables.  For example...

 

    Map<String, String> CountryAbbreviationToInternationalTerritoryMap = new Map<String, String>();
         
    CountryAbbreviationToInternationalTerritoryMap .put('BI', 'EMEA');
    CountryAbbreviationToInternationalTerritoryMap .put('KM', 'EMEA');

    ...

 

Because there are a large number of entries to initialize the table with, we run into the "too many script statements" governor limit when this utility class is invoked from a trigger.

 

Is there a best practices for initializing a lookup table that doesn't require a lot of script statements?

 

 ~Bob