[SalesForce] How to create salesforce restricted picklist

While creating a picklist or a multipicklist it is unrestricted by default.How do I change the picklist to a restricted picklist?

Best Answer

If you're displaying a picklist field on a standard salesforce page you will not be able to enter any other values apart from the one's available in the picklist. But you can set any values to the picklist if you're setting it from code(apex). AFAIK there's no such setting in salesforce which will prevent it from happening.

To avoid it you can create a validation rule which checks if the value set in the picklist is correct. You could do the same from a trigger if you have some complex logic to allow specific values in special cases.