I understand the difference between mdapi format and source format, but there's one thing in the documentation that I find confusion with respect to field definitions and I'm wondering if I am missing something nuanced or if the docs are poorly worded.

Per the SFDX Developer Guide Project Structure and Source Format page:

Some parts of the custom objects are extracted into in these subdirectories:


The parts of the custom object that are not extracted are placed in a file.
For objects, <object>.object-meta.xml
For fields, <field_name>.field-meta.xml

The top part breaking down the subdirectories makes sense, as do the following two lines:

The parts of the custom object that are not extracted are placed in a file.
For objects, <object>.object-meta.xml

The part that doesn't make sense to me is the next line:

For fields, <field_name>.field-meta.xml

This makes it sound as if not all fields will live in the fields subdirectory.

I've examined my own project in source format. The custom objects have their own <object>.object-meta.xml file, and individual custom fields each get their own <field_name>.field-meta.xml files in the object's fields subdirectory.

Is there a case, when working with source format, where there are field metadata files that do not live in the fields subdirectory for an object? Or is it just awkward terminology in the docs?


As far as I've observed (custom settings, platform events, normal custom objects, standard objects, and custom metadata), the fields are always in the fields directory, with the name <field-name>.field-meta.xml. This is simply confusing documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.