function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris Baker 25Chris Baker 25 

Error when trying to change usernames in Production or Sandbox

I'm getting this error if I try to change someone's username in Production as well as Sandboxes

Error: Please do not change usernames in the Trailhead Playground.

I am not in a Trailhead Playground so I don't know why this is happening
Raj VakatiRaj Vakati
This is a restriction in trailhead playground and you cannot change the usernames of the trailhead playground which were created by default when you create the trailhead playground.
 
Abu Wahid 7Abu Wahid 7
Hi Chris,

Salesforce doesn't want you to change the user name, but if you really have to (like no other options) then decative the User object's validation rule "NoUsernameChangesAllowed" and update the user name. After that make sure to activate the validation rule again.

Thanks,
AW