Skip to main content
Hello team, I have the next problem. I hope that someone can help me.

 

When I refresh some Sandbox the users are copied with the email emailname=domain.com@example.com, I need the correct email in the sandoxes.

 

I tryed using a class that run after the sandbox refresh using the following option:

 

Replace the emailname=domain.com@example.com for the correct email after the sandbox refresh

 

And I used the following class:

 

 

global class Sandbox_Refresh implements SandboxPostCopy {

global void runApexClass(SandboxContext context) {

List<User> UserList = [SELECT Email FROM User where Email LIKE '%@example.com%'];

for(User u : UserList){

u.Email = u.Email.replace('@example.com', '').replace('=', '@');

}

if(!UserList.isEmpty()){

update UserList;

}

}

}

 

This class was executed without problems. But the email's users was not update how we expected.

 

Are there some way to update this emails after the refresh a Sandbox?

 

Regards
2 respuestas
0/9000