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 component | These components are automatically added |
|---|---|
| Action | Action 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 class | Custom fields, custom objects, and other explicitly referenced Apex classes, and anything else that the Apex class references directly |
| Apex trigger | Custom fields, custom objects, and any explicitly referenced Apex classes, and anything else that the Apex trigger references directly |
| Article type | Custom fields, the default page layout |
| Compact layout | Custom fields |
| Custom app | Custom tabs (including web tabs), documents (stored as images on the tab), documents folder, asset files |
| Custom button or link | Custom fields and custom objects |
| Custom field | Custom objects |
| Custom home page layouts | Custom home page components on the layout |
| Custom settings | Apex sharing reasons, Apex sharing recalculations, Apex triggers, custom fields, list views, page layouts, record types, validation rules, or custom buttons or links. |
| Custom object | Custom fields, validation rules, page layouts, list views, custom buttons, custom links, record types, Apex sharing reasons, Apex sharing recalculations, and Apex triggers |
| Custom object (as an external object) | External data source, custom fields, page layouts, list views, custom buttons, and custom links |
| Custom tab | Custom objects (including all of its components), s-controls, and Visualforce pages |
| Dashboard | Folders, reports (including all of its components), s-controls, and Visualforce pages |
| Document | Folder |
| Email template (Classic) |
|
| Email template (Lightning) |
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:
|
| Email template (Lightning) created in Email Template Builder |
These items aren’t included and can’t be added to a package:
|
| External Credential | Permission set and authentication provider |
| Field set | Any referenced fields |
| Lightning page | All 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 tab | Lightning page |
| Flow | Custom objects, custom fields, Apex classes, and Visualforce pages |
| Folder | Everything in the folder |
| Lightning application | All 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 component | All 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 event | Custom fields, custom objects, list views, and page layouts |
| Lightning interface | Custom fields, custom objects, list views, and page layouts |
| Lightning web component | All 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 Credential | External credential; for legacy named credentials, an authentication provider |
| Page layout | Actions, custom buttons, custom links, s-controls, and Visualforce pages |
| Permission set | Any custom permissions, external data sources, Visualforce pages, record types, and Apex classes that are assigned in the permission set |
| Record type | Record type mappings, compact layout |
| Report | Folder, custom fields, custom objects, custom report types, and custom s-controls |
| Reporting Snapshot | Reports |
| S-control | Custom fields and custom objects |
| Translation | Translated terms for the selected language on any component in the package |
| Validation rule | Custom fields (referenced in the formula) |
| Visualforce home page component | Associated Visualforce page |
| Visualforce pages | Apex classes that are used as custom controllers, Visualforce custom components, and referenced field sets |
| Workflow rule | All 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 |