You need to sign in to do that
Don't have an account?
Arnold Joseph Todas
Duplication of Name in Account
How can i ignore the word of The, An, A in when i create an account Name for example The Company = Company; An Company = Company; it should show an error and it will not added to the list. And how can i put the SELECT query outside the loop here is my code :
Thanks For Help!
AJ
public static void checkDuplicateName(List<Account> newRecord){ Set<String> str = new Set<String>{'The','An','A'}; for(Account account: newRecord){ List<Account> existingName = [SELECT Id, Name FROM Account WHERE Name =: account.Name]; if(existingName.size()>0){ account.adderror('You cannot create a duplicate Name'); } } }
Thanks For Help!
AJ
NOTE: This code has not been tested and may contain typographical or logical errors.
unexpected token: '{' at line 23 column 48, i'm newbie here.
Thank you !
AJ
error in String newName = nameParts.join(' ');
Method does not exist in String.
Thanks!
AJ