REQUIRED_FIELD_MISSING: Required fields are missing: [FieldName]
You tried to create or update a record without populating a field that the object requires. The error message lists the exact API names in brackets — those are what you need to populate before retry.
Also seen asREQUIRED_FIELD_MISSING·Required fields are missing·REQUIRED_FIELD_MISSING: Required fields are missing
The platform refuses to save records missing required fields. Easy to fix; the gotcha is figuring out what counts as required, because there are three different layers of "required."
The three required-ness layers
| Layer | Where defined | Affects |
|---|---|---|
| Universally required at the field level | Field setup → Required checkbox | All record creation, every API, every UI |
| Required on the page layout | Page Layout Editor | Only via that layout's UI; not API-enforced |
| Required by validation rule | Object → Validation Rules | Any save (including API), if rule conditions met |
If your error message lists a field, it's layer 1 or layer 3, not layer 2. Page-layout-only required is a UI nicety; the API doesn't enforce it.
Why the field is sometimes invisible
If the integration user doesn't have Edit access on the field but the field is required, the API tells you the field is missing — even though the user wouldn't be allowed to set it anyway. Field-Level Security is checked before required-ness. Fix: grant the integration user Edit on the field, or remove the required flag.
The Apex pattern that triggers this 90% of the time
Account a = new Account();
a.Name = 'Acme';
insert a; // OK if only Name is required
Contact c = new Contact();
c.LastName = 'Smith';
// c.AccountId = a.Id; <-- forgot this; 'AccountId' is required in many orgs
insert c; // REQUIRED_FIELD_MISSING: [AccountId]
Always look at the bracketed list. The platform tells you exactly which fields you skipped.
When the missing field is on a relationship target
Sometimes the missing field is on a parent record that you're trying to upsert through a relationship:
Contact c = new Contact(LastName = 'Smith');
c.Account = new Account(); // empty Account; Name is required on Account
upsert c Contact.Email__c;
The error will name the parent's required field. Build the parent fully or supply an existing parent ID.
A pattern that hides the error
Defensive code sometimes wraps every save in a try/catch and only logs e.getMessage(). If you see this error in your log but no list of missing fields, you've thrown away e.getDmlFieldNames(0). Always log:
} catch (DmlException e) {
System.debug(
'Missing fields: ' + e.getDmlFieldNames(0)
+ ' on row ' + e.getDmlIndex(0)
);
}
