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
Diwakar GDiwakar G 

Duplicating the User object Language field


I want duplicate the User object - Language field i.e. the picklist values of Language field should be copied to the different object - Language field using apex. How can I do this?

Thanks in advance.
SandhyaSandhya (Salesforce Developers) 

You can get the values available in the User object Locale field in Apex using:
for (PicklistEntry pe : User.LocaleSidKey.getDescribe().getPicklistValues()) {
    system.debug(pe.getValue() + ' ' + pe.getLabel());

Refer below link.
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards