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
Jagmohan Singh 8Jagmohan Singh 8 

Change 'UserPreferencesLightningExperiencePreferred' with Field Update

Hi all,

I want to change a field in the User object with a workflow rule, but I can't select this field. It's the field 'UserPreferencesLightningExperiencePreferred' which is set to True automatically for new users in our org. I can't find this field though Set-up either, but it is visible through Workbench and the Developer Console.

What am I missing?
Raj VakatiRaj Vakati
You can able to do it with the Trigger  or flow with process builder 


Refer to this link

https://automationchampion.com/category/user-management/

Code some think like below
 
trigger UserTrigger on User (before update) {
        for(User user : Trigger.new) {
			System.debug('Debug Log for User Preference'+user.UserPreferencesLightningExperiencePreferred);
				if(user.UserPreferencesLightningExperiencePreferred = false){
                user.UserPreferencesLightningExperiencePreferred = true;
                }
            }
}