-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot separate SObject metadata (fields, validationRules) into modules inside single package (sometimes) #2230
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Hello @packocz 👋 None of the versions of Shared: Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. After updating, share the full output of |
Updated to latest version, same problem persists. (updated original post with new json version output) |
This issue has been linked to a new work item: W-13629588 |
Can you populate the repro repo? It's empty https://github.com/packocz/SObjectSeparation |
@mshanemc sorry, published now |
@packocz I'm very confused on the repro steps. Now that we have the repo, it has 4 mdapi-format directories . What command are you running to deploy those together? Or has your repo changed since the repro steps were written? |
@mshanemc The deployment I tested with just |
This could be a dangerous/challenging fix. On the list |
Adding my two cents that this is something impacting us as well. |
Summary
When there are multiple folders for the same object, it is important in which of them the object's
object-meta.xml
file is placed. If it is in the first one (alphabetically), then all is well. If it is not though, then the below error appears during deployment. And the reason seems to be that the main object metadata is then "lost""Must specify a non-empty label for the CustomObject"
When using
force source convert
instead ofdeploy
resuts show that generatedCustomObject__c.object
is missing the object level attributes whenCustomObject__c.object-meta.xml
was not placed in the alphabetically first module/folder. All fields or validation rules are present regardless of their placement. On the other hand whenCustomObject__c.object-meta.xml
is in the first one, all fields and validation rules as well as object level attributes are there and all is well.More detailed description in this Stack Exchange question if needed
It seems somewhat similar to this existing issue. Though it's about the same xml file existing twice, while this is separate sub-parts of the object metadata coming from different folders (no duplication)
Steps To Reproduce
Reproduce issue [here](https://github.com/packocz/SObjectSeparation. Single package defined in sfdx-project.json)
3 different sub-modules inside this package. Each contains the same
objects/CustomObject__c/
folder, one meant to define the object, 2 feature sub-modules add fields/validationRules. This only works ifCustomObject__c.object-meta.xml
is in the alphabetically first folder.force-app
pacakge into any (empty) org usingsfdx force source deploy --sourcepath force-app --target-org XXXXX --checkonly
>> produces errorCustomObject__c.object-meta.xml
fromforce-app/main/default/objects/CustomObject__c/
intoforce-app/aa-package/objects/CustomObject__c/
force-app
pacakge into any (empty) org usingsfdx force source deploy --sourcepath force-app --target-org XXXXX --checkonly
>> works fineExpected result
Package deploys with all expected custom Fields and Validation Rules
Actual result
Deploy fails with missing attributes that are actually defined in the source
System Information
zhs terminal
Mac OS 13.4
The text was updated successfully, but these errors were encountered: