Universally required versus page-layout required fields
Key Takeaway
A page layout makes a field required only on the detail and edit pages that use that layout. To require a value no matter where a save comes from, make the custom field universally required in its field definition.
Salesforce gives you two main ways to make a field required. You set a universally required field on the field definition, and it must have a value every time a record is saved, no matter where the save comes from. A page-layout required field is required only on the detail and edit pages that use that layout, so it works at the presentation level. Making a field universally required gives a higher level of data quality than this presentation-level control.
Where each kind of required field applies
The requirement on a universally required field covers saves in these places:
- Within Salesforce
- The Lightning Platform API
- Connect Offline
- Salesforce for Outlook
- The Self-Service portal
- Automated processes such as Web-to-Lead and Web-to-Case
Universally required fields are not enforced everywhere, however. Quick Create does not enforce them. Salesforce enforces them during lead conversion only if validation and triggers for lead conversion are enabled in the org.
A page-layout setting covers less. Page layouts set whether fields are visible, read-only, or required on detail and edit pages only.
The two also differ across record types. Universally required fields are required across all record types. Each page layout applies to a particular record type, so a page-layout setting applies only to the record type that uses that layout.
For example, imagine an object with two record types, each with its own page layout. If you set a custom Date field to required on one of those layouts, the setting applies to one record type. If you make that field universally required instead, it is required for both record types.