Components Automatically Added to First-Generation Managed Packages

When adding components to your first-generation managed package, related components are automatically added. For example, if you add a Visualforce page to a package that references a custom controller, that Apex class is also added.

To understand what components are automatically included in first-generation managed packages, review the following list:

When you add this componentThese components are automatically added
ActionAction target object (if it’s a custom object), action target field, action record type, predefined field values, action layout; and any custom fields that the action layout or predefined values refer to on the target object
Apex classCustom fields, custom objects, and other explicitly referenced Apex classes, and anything else that the Apex class references directly. If an Apex class references a custom label, and that label has translations, you must explicitly package the individual languages desired for those translations to be included.
Apex triggerCustom fields, custom objects, and any explicitly referenced Apex classes, and anything else that the Apex trigger references directly
Article typeCustom fields, the default page layout
Compact layoutCustom fields
Custom appCustom tabs (including web tabs), documents (stored as images on the tab), documents folder, asset files
Custom button or linkCustom fields and custom objects
Custom fieldCustom objects
Custom home page layoutsCustom home page components on the layout
Custom settingsApex sharing reasons, Apex sharing recalculations, Apex triggers, custom fields, list views, page layouts, record types, validation rules, or custom buttons or links.
Custom objectCustom fields, validation rules, page layouts, list views, custom buttons, custom links, record types, Apex sharing reasons, Apex sharing recalculations, and Apex triggers. Apex sharing reasons are unavailable in extensions. When packaged and installed, only public list views from an app are installed. If a custom object has any custom list views that you want to include in your package, ensure that the list view is accessible by all users.
Custom object (as an external object)External data source, custom fields, page layouts, list views, custom buttons, and custom links. When packaged and installed, only public list views from an app are installed. If an external object has any custom list views that you want to include in your package, ensure that the list view is accessible by all users. In managed and unmanaged packages, external objects are included in the custom object component.
Custom tabCustom objects (including all of its components), s-controls, and Visualforce pages
DashboardFolders, reports (including all of its components), s-controls, and Visualforce pages
DocumentFolder
Email template (Classic)Folder, Letterhead, Custom fields, and Documents (stored as images on the letterhead or template)
Email template (Lightning)Custom object, Custom field references (in Handlebars Merge Language syntax), Enhanced folder (except the default public and private folders), Inline images referencing Salesforce Files, and Attachments referencing Salesforce Files. For Lightning email templates created before Spring ’21, attachments aren’t automatically added to the package. Open and resave these templates to turn the attachments into content assets, which are then automatically added to the package. These items aren’t included and can’t be added to a package: Enhanced letterhead, the associated FlexiPage, or CMS files (Account Engagement only).
Email template (Lightning) created in Email Template BuilderCustom object, Custom field references (in Handlebars Merge Language syntax), Enhanced folder (except the default public and private folders), Inline images referencing Salesforce Files, Attachments referencing Salesforce Files, and the associated FlexiPage. These items aren’t included and can’t be added to a package: Enhanced letterhead or CMS files (Account Engagement only).
External CredentialPermission set and authentication provider. External credentials that use the Oauth 2.0 authentication protocol must reference an authentication provider to capture the details of the authorization endpoint. If you add an external credential that references an authentication provider, the authentication provider is added to the package. See Authentication Providers for information on which elements of an authentication provider are and aren’t packageable.
Field setAny referenced fields
Lightning pageAll Lightning resources referenced by the page, such as record types, actions, custom components, events, and interfaces. Custom fields, custom objects, list views, page layouts, Visualforce pages, and Apex classes referenced by the components on the page.
Lightning page tabLightning page
FlowCustom objects, custom fields, Apex classes, and Visualforce pages
FolderEverything in the folder
Lightning applicationAll Lightning resources referenced by the application, such as components, events, and interfaces. Custom fields, custom objects, list views, page layouts, and Apex classes referenced by the application.
Lightning componentAll Lightning resources referenced by the component, such as nested components, events, and interfaces. Custom fields, custom objects, list views, page layouts, and Apex classes referenced by the component.
Lightning eventCustom fields, custom objects, list views, and page layouts
Lightning interfaceCustom fields, custom objects, list views, and page layouts
Lightning web componentAll Lightning web component resources referenced by the component, such as nested components and modules. Custom fields, custom objects, list views, page layouts, and Apex classes referenced by the component
Named CredentialExternal credential; for legacy named credentials, an authentication provider
Page layoutActions, custom buttons, custom links, s-controls, and Visualforce pages
Permission setAny custom permissions, external data sources, Visualforce pages, record types, and Apex classes that are assigned in the permission set
Record typeRecord type mappings, compact layout
ReportFolder, custom fields, custom objects, custom report types, and custom s-controls
Reporting SnapshotReports
S-controlCustom fields and custom objects
TranslationTranslated terms for the selected language on any component in the package
Validation ruleCustom fields (referenced in the formula)
Visualforce home page componentAssociated Visualforce page
Visualforce pagesApex classes that are used as custom controllers, Visualforce custom components, and referenced field sets
Workflow ruleAll associated workflow alerts, field updates, outbound messages, and tasks; also, if the workflow rule is designed for a custom object, the custom object is automatically included

Some package components, such as validation rules or record types, don’t appear in the list of package components, but are included and install with the other components.

Note