I thought I knew this stuff but in Triggers and Order of Execution Step 2
- Loads the new record field values from the request and overwrites the old values.
If the request came from a standard UI edit page, Salesforce runs system validation to check the record for:
Compliance with layout-specific rules
Required values at the layout level and field-definition level
Valid field formats
Maximum field length
When the request comes from other sources, such as an Apex application or a SOAP API call, Salesforce validates only the foreign keys. Before executing a trigger, Salesforce verifies that any custom foreign keys do not refer to the object itself.
Based on my tests (
- From execute anonymous
- From workbench REST POST (I did not try SOAP)
Salesforce validates field lengths, required fields, and field formats BEFORE the triggers execute.
I can appreciate how Salesforce needs to reverify these at the conclusion of the before trigger (Step 4).
I looked back at the doc all the way to V30.0 and the same language is present for Step 2.
Is this a doc bug or where am I wrong?