[SalesForce] How to mass update a field on User Record

I am trying to update a field on all users in the organization. Ex: I would like to update the company name for all users in my organization.

I tried these:
– Create a list view of all users and try to mass update by double clicking but I am unable to (P.S: I enabled enhanced lists and inline editing from Setup > User Interface)

  • I tried to do this from Developer Console:

list abc = [ Select Title From Users ];
for(Users abc : abc) {
abc.title = 'Hello';
}
update abc;

Even this didn't work

Can someone please help me on this.

I am a newbie to salesforce community

Best Answer

Please query id as well.

List abc = [ Select id,Title From User ]; 
for(User abc : abc) 
{ abc.title = 'Hello'; } 
update abc;
Related Topic