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 

Copying the existing field values to new field

1) I want to duplicate the Locale and Language field of User object to the Quote object.
2) Referring to the figure attached, if I select English (United States) or English (United Kingdom) or English (Vanuatu) from Locale, English should be automatically populated to Language field. How can I do this using apex?

Thanks in advance.
User-added image
Saurabh Sood 12Saurabh Sood 12
Hi Diwakar G,
use global picklist so you can access in any object
Diwakar GDiwakar G
Thanks for reply. Can you please ellaborate how can I use global picklist?
Brahmaiah GantaBrahmaiah Ganta
we don't need apex for this requriment.just create dependent will auto populate that value.
Saurabh Sood 12Saurabh Sood 12
From Setup, enter Picklist in the Quick Find box, then select Picklist Value Sets.
Next to Global Value Sets, click New.
Enter a label for the global value set. ...
To tell users what these values are for, enter a specific description of the global value set. ...
Enter the values, one per line.

 Once Global Picklists is created
On each specific object, create the picklist fields (referencing the Global picklist values) and then add the Field Dependencies to link them. Important: Add all of the picklist values to all relevant record types on each object.
Diwakar GDiwakar G
Thanks for reply. I understood the concept of Global picklist. But, Locale and Language field and its values are already defined, then is it required to define global picklist with the same values?