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
Paulo CastroPaulo Castro 

Newbie question - Picklist not null field

Hi guys,

 

 I'm starting to code my app using Force plataform.

 At this moment I'm creating my custom objects, and one of the fields is a picklist that I want to make required to be chose, but on the other side I don't want to make the first option default.

 So I tryed to use the required attribut equal to true, but I got the following error message:

 

 Can not specify 'required' for a CustomField of type Picklist

 

 How could I handle this?

 

 Tnx in advance.

 

 Best regards,

 

 PH
 

Best Answer chosen by Admin (Salesforce Developers) 
shillyershillyer

You can also make the custom picklist field required on the page layout. Edit the page layout, double-click on the picklist field and check the Required box.

 

Hope that helps,

Sati

All Answers

micwamicwa

Use a validationrule

 

ISPICKVAL( YourField__c ,'')

shillyershillyer

You can also make the custom picklist field required on the page layout. Edit the page layout, double-click on the picklist field and check the Required box.

 

Hope that helps,

Sati

This was selected as the best answer