Search code examples
salesforceapex-codevisualforce

Removing None Option in PickList visualforce apex


i have created an object with name PS_Detail__c .in this custom object i created a custom field .in this picklist i defined two values Dollar ,Unithere is screen shot for field description.. when i go to P/S Detail Tab for creating a new PS_Detail__c object then i get None also as a value in picklist field .i want only Dollar and Unit as Picklist values .some one please help how to remove this None from Picklist !! enter image description here


Solution

  • As you have discovered, you cannot make this picklist required at the object level. However, making this field required on the page layout will remove the -None- option from the available options.

    To do this, edit the page layout on your object and select the wrench icon next to your field: select the wrench icon next to your field

    Then, you should be able to check the "Required" box in the dialogue box that pops up: check the "Required" box in the dialogue box that pops up