nvuillam / sfdx-essentials

Toolbox for Salesforce DX to provide some very helpful additional features to base sfdx commands
GNU General Public License v3.0
51 stars 14 forks source link

Filter Package.xml: CustomObjects with __mdt and __feed not filtering correctly #40

Open fitzman49 opened 4 years ago

fitzman49 commented 4 years ago

Describe the bug Specific object definitions ending in mdt and feed are not getting filtered correctly when running the package.xml filter command. They do not contain all the metadata from the original file which results in deployment failures using SFDX MDAPI commands. According to the documentation these types of files are supported by Salesforce and should be deployable: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_custom_objects_list.htm.

To Reproduce Steps to reproduce the behavior:

  1. Define a CustomObject metadata type in package.xml that ends with mdt or feed. Ensure this CustomObject has custom fields created against it. `MyCustomObject__mdt CustomObject`
  2. Run the essentials:metadata:filter-from-packagexml command against that package.xml
  3. Observe that the custom fields are not present in the resulting file. It only contains a shell of what the object should look like.
  4. Deploying this out using SFDX MDAPI commands will result in a failure if other metadata defined in package.xml depend on these custom fields.

Expected behavior Filtered sub-metadata (fields, listviews, etc) should be filtered correctly and included in the produced file similar to standard objects and custom objects ending in __c.

fitzman49 commented 4 years ago

FYI I was able to work around this by defining the custom object and all custom fields for the new object. Not ideal but it works.

nvuillam commented 4 years ago

I don't have a lot of time to work on that these days... maybe you can submit a pull request ? :)