I know that the alias in User record is auto-populated. However, I would like to update this as the last name was entered incorrectly. It seems like Salesforce do not allow me to do so. How do I edit/update the alias in existing User Record?
2 Answers
I just tried it in a dev. org. and I was able to update the Alias field using the standard UI.
Go to Setup -> Users -> Select User -> Edit -> Enter Alias -> Save.
-
1Thanks Davin! I finally found that there's an existing validation rule in my org that restrict me to update the field in the first place.– CherylSep 9, 2014 at 9:32
-
Try :
User u = [SELECT Id, Alias FROM User WHERE ...]; // Get the user you want to update
u.Alias = 'MyNewAlias';
update u;
system.debug(u.Alias);