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
kalyforminkalyformin 

Default value for a picklist in Apex class

Is there a way to set a default value for a picklist in an Apex class? I'm using a custom controller for a VF page which appears to override the default value set.
kalyforminkalyformin

I found the answer. I defaulted my picklist in the constructor of my controller class.

 

 <objectname>.<fieldname> = '<defaultvalue>';