Question
Error while creating managed package — entities not compatible
I’m creating a managed package and when creating the package I get this error:
Warning: (1) Estas entidades no son compatibles: [Role, Group]
Translation: these entities are not compatible: [Role, Group]
The package.xml contains:
<types>
<members>Todos_los_usuarios</members>
<name>Group</name>
</types>
...
<types>
<members>R2C2_corporativo</members>
<name>Role</name>
</types>
The Todos_los_usuarios.group-meta.xml
contains:
<?xml version="1.0" encoding="UTF-8"?>
<Group xmlns="http://soap.sforce.com/2006/04/metadata">
<doesIncludeBosses>true</doesIncludeBosses>
<name>Todos los usuarios</name>
</Group>
The R2C2_corporativo.role-meta.xml
contains:
<?xml version="1.0" encoding="UTF-8"?>
<Role xmlns="http://soap.sforce.com/2006/04/metadata">
<caseAccessLevel>Edit</caseAccessLevel>
<contactAccessLevel>Edit</contactAccessLevel>
<mayForecastManagerShare>false</mayForecastManagerShare>
<name>R2C2 corporativo</name>
<opportunityAccessLevel>Edit</opportunityAccessLevel>
</Role>
I don’t know how to solve this error since I don’t understand what’s wrong…
Any help would be greatly appreciated. Thx
Answer
The error indicates that the Role
and Group
entities are not compatible with each other when creating a managed package. This typically happens because Salesforce imposes certain limitations on what metadata types can be included in managed packages. Here are potential solutions to resolve this issue.
Solution 1: Remove Role
Metadata from the Package
Roles (Role
metadata) are considered organization-specific and cannot be included in managed packages. Managed packages are designed to be reusable across multiple orgs, and since roles are tied to the specific hierarchy of an org, Salesforce does not allow their inclusion.
To resolve this:
- Remove the
Role
definition frompackage.xml
:<types> <members>R2C2_corporativo</members> <name>Role</name> </types>
- Ensure that any related metadata that references this role is also updated to remove dependencies on
R2C2_corporativo
. - If the role is critical, document its creation and configuration so the package users can manually create it in their org.
Solution 2: Include Only Supported Metadata
Groups (Group
metadata) are generally supported in managed packages. Ensure that the group metadata is properly defined and does not depend on unsupported entities, such as roles.
- Verify the
Todos_los_usuarios.group-meta.xml
file:<?xml version="1.0" encoding="UTF-8"?> <Group xmlns="http://soap.sforce.com/2006/04/metadata"> <doesIncludeBosses>true</doesIncludeBosses> <name>Todos los usuarios</name> </Group>
Ensure it complies with the Salesforce metadata API specifications. - Keep only the group metadata in the
package.xml
:<types> <members>Todos_los_usuarios</members> <name>Group</name> </types>
- Validate the managed package creation after making these changes.
Solution 3: Utilize Permission Sets or Profiles Instead
If the role and group hierarchy is essential for your application, consider using Permission Sets or Profiles instead. These metadata types are supported in managed packages and can replicate certain permissions and access controls provided by roles.
- Define necessary access levels in permission sets.
- Assign the permission sets to appropriate users or roles in the target org.
- Replace
Role
metadata references in your application with permission set logic wherever possible.
Additional Notes
- Roles are org-specific and must be configured manually after deploying the package.
- Always test your managed package in a new developer org or a scratch org to verify compatibility.
- Document any manual setup steps required for unsupported entities like roles.
By removing the unsupported Role
metadata and validating your Group
definitions, you should be able to successfully create your managed package.
Job-Oriented Salesforce Course: Enroll for Free Demo
Our Salesforce Course delivers an all-encompassing learning experience, crafted to help you gain mastery over the Salesforce platform and pave the way for a successful career. Whether you aspire to become a Salesforce Administrator, Developer, or work on AI integrations, our courses delve into every essential aspect of the platform. With an emphasis on practical application through real-world projects, our training ensures you build hands-on expertise and can address real business challenges effectively. Guided by experienced industry professionals, our program equips you with the knowledge and confidence to thrive in the Salesforce ecosystem.
In addition to comprehensive technical training, our Salesforce training in India provides exceptional career development support. This includes personalized mentorship and expert advice to help you prepare for certifications. From in-depth learning materials to real-time project work and targeted interview coaching, we ensure you’re fully prepared for the job market. Our ultimate goal is to not only strengthen your Salesforce proficiency but also to position you for success in your next role. By completing the program, you’ll acquire the skills, experience, and confidence needed to excel in Salesforce and advance your career.