Salesforce Platform Developer I (legacy) — Question 169

A custom picklist field, Food_Preference_c, exists on a custom object. The picklist contains the following options: “Vegan”, “Kosher”, “No Preference”. The developer must ensure a value is populated every time a record is created or updated.

What is the optimal way to ensure a value is selected every time a record is saved?

Answer options

Correct answer: D

Explanation

The correct answer is D because marking the field as Required in the field definition ensures that a value must be provided before a record can be saved. Options A and C do not enforce this requirement at the database level, and option B only sets a default without guaranteeing a selection is made.