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
Pradnya79Pradnya79 

How to edit User object field 'Admin Info Emails' ?

User objet in salesforce has a field 'Admin Info Emails'. This field is checkbox. In our org, the users of same profile(customer service profile), this field has different status for different users(of same profile). How to edit this button?
Thanks in advance
Best Answer chosen by Pradnya79
PreyankaPreyanka
Hello Pradnya,

From standard User Page layout you are not able to see the checkbox. To update the 'Admin Info Emails' field of user for profile 'customer service profile', please use below query in developer console or you can do the same using Apex class (If the number of record is huge).
 
select Id, Name, ReceivesAdminInfoEmails from User where ReceivesAdminInfoEmails =true and ProfileId ='IDOFprofilecustomerservice' limit 10

You can use ReceivesAdminInfoEmails =true or ReceivesAdminInfoEmails =false depends on you requirement.

Thanks 
Preyanka

All Answers

PreyankaPreyanka
Hello Pradnya,

From standard User Page layout you are not able to see the checkbox. To update the 'Admin Info Emails' field of user for profile 'customer service profile', please use below query in developer console or you can do the same using Apex class (If the number of record is huge).
 
select Id, Name, ReceivesAdminInfoEmails from User where ReceivesAdminInfoEmails =true and ProfileId ='IDOFprofilecustomerservice' limit 10

You can use ReceivesAdminInfoEmails =true or ReceivesAdminInfoEmails =false depends on you requirement.

Thanks 
Preyanka
This was selected as the best answer
Raj VakatiRaj Vakati
Go to deleveloper console and execute the below code
 
List<User> u =[select Id, Name, ReceivesAdminInfoEmails 
               from User where ReceivesAdminInfoEmails =true AND ProfileId='PROFILEID '] ;
for(User u1 :u){
    u1.ReceivesAdminInfoEmails=false ;
    
    
}
update u ;

OR
 
List<User> u =[select Id, Name, ReceivesAdminInfoEmails 
               from User where ReceivesAdminInfoEmails =true AND ID ='USER ID'] ;
for(User u1 :u){
    u1.ReceivesAdminInfoEmails=false ;
    
    
}
update u ;

Raj VakatiRaj Vakati
Set<String> uIds = new Set<String>();
uIds.add('UserID1');
uIds.add('UserID2');
​uIds.add('UserID3');
​
List<User> u =[select Id, Name, ReceivesAdminInfoEmails 
               from User where ReceivesAdminInfoEmails =true AND ID  IN :uIds ] ;
for(User u1 :u){
    u1.ReceivesAdminInfoEmails=false ;
    
    
}
update u ;

 
Pradnya79Pradnya79
Really appreciate quick response. 
Thanks a ton for this information.
PreyankaPreyanka
Hello Pradnya,

If it solves your queries please select it as best answer that can help other also.

Thanks