You need to sign in to do that
Don't have an account?
staylor
Can someone please help me create test class?
I'm very new at working with Apex code. Can someone please help me create a test class for the following Apex trigger?
1 2 3 4 5 6 7 8 9 10 11 12 13 | trigger LeadFixPhoneFormat on Lead (before insert, before update) { for (Lead i : Trigger.new) { // Fix Phone Number issues if (i.Phone != NULL) { if (i.Phone.startsWith('+1')) { i.Phone = i.Phone.substring(3); i.Phone = i.Phone.replace('.', '-'); i.Phone = i.Phone.replaceFirst('(^[0-9][0-9][0-9]).','($1) '); } i.Phone = i.Phone.replace('.', '-'); } } } |
Thank you in advance!
try this out