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
Shatrughna SalunkeShatrughna Salunke 

Insert value in custom picklist using apex code

Hello,

How do I insert values in the custom picklist using apex trigger.

Regards,
Shatrughna
ShirishaShirisha (Salesforce Developers) 
Hi Shatrughna,

Greetings!

You would need to use MetadataService class to add the picklist value to your picklist as suggested in the below thread:

https://salesforce.stackexchange.com/questions/65774/how-can-i-add-a-new-value-to-a-picklist-using-apex

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri