Skip to main content
Hello,

I need an advice regaring the following implementation. I need to normalize large set of user generated company names for instance 'Derby International LLC', and I need the company name without its extension. In this case the extension is 'LLC'. I use an algorithm which I wrote myself in order to remove the extensions from the name of the company which is working ok. However, in order to get the extesnsions I used a list to store each company extension. Here is the code:List<String> companyExtensionsList = new List<String>(); private static void initCompanyExtensions() { companyExtensionsList.add('ltd'); companyExtensionsList.add('inc'); companyExtensionsList.add('group'); companyExtensionsList.add('corp'); companyExtensionsList.add('llc'); companyExtensionsList.add('llp'); companyExtensionsList.add('lp'); }The company extensions are actually a list of constants.

What I need to know is whether there is a better approach to store the extensions instead of storing the them into a list strings?

Regards,

Dilyan
8 answers
  1. Jan 7, 2016, 4:24 PM
    Hi,

    I've created a custom setting with the company extensions, please take a look at my last screenshot added. What I've noticed is that the when I convert Lead to Account the code enters the first for loop but when I run the test from the test class the List<Company_Extensions__c> extensions does not contain elements because it does not enter the for loop. Could you please advise what I need to do and how to run the test so it can enter the first for loop?

    Regards,

    Dilyan
0/9000