Created
April 22, 2020 09:05
-
-
Save jsullivanlive/5a6081e34cd93d6ca9c68adc980cdd82 to your computer and use it in GitHub Desktop.
fix appexchange sandbox emails.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* scheduled hourly */ | |
List<Lead> leads = [ | |
select Id, Email | |
from Lead | |
where IsConverted = false | |
and Email like '%=%@%example.com' | |
limit 100 | |
]; | |
for (Lead l : leads) { | |
String e = l.Email; | |
e = e.replace('@example.com', ''); | |
e = e.replace('=', '@'); | |
System.debug(l.Email + ' => ' + e); | |
l.Email = e; | |
} | |
//update leads; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment