You need to sign in to do that
Don't have an account?

Company names list configuration
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
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
[1] https://help.salesforce.com/HTViewHelpDoc?id=cs_about.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=cs_about.htm&language=en_US)
Thank you for your advice but for some reason it is not possible to read the element values from the custom list Company_Extensions__c.
Here is how I attempt to read the elements
Here is screenshot of the List Company_Extensions__c and the elements of the list created in my Salesforce sandbox.
Please find the attached image file.
Please advise what am I doing wrong and how to get the elements from the List Company_Extensions__c?
I have the following method
When I run test from a test class
for some reason List<Company_Extensions__c> extensions does not contain elements because it does not enter the first for loop.
Here are the details from the log:
Could please advise how to get the values of the emlements from the list.
Additionally, I would really recommend that you use the Pattern / Matcher construct I provided because it will be faster for large data sets.
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