Skip to content

Error: CustomField Not in package.xml when defining custom field in child managed 2gp from a custom object created in parent managed2gp under the same namespace #3227

@jorgesolebur

Description

@jorgesolebur

Summary

I am not able to install a child managed 2gp version that has a custom field in a custom object from its parent managed 2gp (in the same namespace). Getting Error: CustomField Not in package.xml for that custom field when trying to install the package. Creation of the package (even with validations) does not fail

Steps To Reproduce

IMPORTANT
1-Create a parent 2gp managed package A under namespace nmsp, and create a custom object O. Create a new beta version for this package
2-Create a child 2gp managed package B. Create dependency between package A and B (we are using cumulusCI), and create in custom object O a field F. The field F will be stored in force-app/main/default/nmsp__O/F__c.xml-meta....
4-Create new package version for package B with NO validation skip. Package can be created successfully
5-Install package version in new scratch org empty. CumulusCI is successfully installing all dependencies, but when trying to install metadata, getting the following errors:
Error: CustomField Not in package.xml, Details: O__c.F__c: Not in package.xml

Expected result

I should be able to successsuly install package

Actual result

Cannot install package (error)

Additional information

System Information

@salesforce/cli/2.78.3 darwin-arm64 node-v20.17.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions