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
manumolumanumolu 

Can we make a picklist field 'Required' at object level after it has been created and used in Apex

Hi,

 

I have an isse where I have a custom picklist field ' Company type' on Lead which has been created , used in Apex code and records for this lead has also been created.

 

 

Please help!!!

 

 

thanks in advance

Manu

Navatar_DbSupNavatar_DbSup

Hi,

 

You can make a picklist field as required field , as go to pagelayout and find that picklist field in page layout and choose that field and click on setting icon and make it as required.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Ankit AroraAnkit Arora

If you only want to make the field required for native layouts then solution provided above is right. Also if you have any visualforce page and want that picklist value required then you can use this code :

 

<div class="requiredInput">
        <div class="requiredBlock" />
        <apex:inputField value="{!Your_Picklist_Field}"/>
</div>

 And validate from controller that it is not blank.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

Saravanan @CreationSaravanan @Creation

Hi

 

u can also use required attribute in apex tag like this.........

 

 <apex:inputField value="{!mul.required__c}" required="true"/>