Some standard required fields in Salesforce — such as the Status field on the Case object — can be set to null when updated via Apex or the Salesforce API, without triggering a validation error. This is unexpected because the fields are marked as required in the Salesforce UI.
The reason this behavior occurs is a metadata-level interaction between two field properties: nillable and defaultedOnCreate.
When a field has defaultedOnCreate: true, Salesforce may mark it as nillable: true, because the system guarantees a default value exists at creation. This combination overrides the required constraint at the programmatic level, allowing null values to be set via Apex DML or API calls without throwing an exception.
This behavior differs from fields on objects like Order, where both nillable and defaultedOnCreate are set in a way that strictly enforces the required constraint at all levels
Salesforce determines whether a field enforces the required constraint programmatically by checking if nillable is set to false. However, this check does not account for fields where defaultedOnCreate is true. When a field has a default value assigned at creation, Salesforce may mark it as nillable: true, knowing it will always have a value after initial record creation. This means some standard required fields (such as Case Status) allow null values via Apex or API without throwing an exception, even though they appear required in the UI.
To check the nillable and defaultedOnCreate properties of a field, use the Salesforce REST API Describe endpoint for the object:
GET /services/data/vXX.X/sobjects/ObjectName/describe
In the JSON response, locate the field definition and review the values for "nillable" and "defaultedOnCreate". If both are true, the field may accept null values via Apex or API despite being required in the UI. If nillable is false, the field enforces the required constraint programmatically.
005225085

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.