Create and Upload a First-Generation Managed Package
| User Permissions Needed | |
|---|---|
| To create packages: | Create AppExchange Packages |
| To upload packages: | Upload AppExchange Packages |
These steps assume you’ve already created a namespace and beta package. If you’re uploading a beta package for testing, see Create and Upload a Beta Package.
- Create a package:
- From Setup, enter Package Manager in the Quick Find box, then select Package Manager.
- Click New.
- Enter a name for your package. You can use a different name than what appears on AppExchange.
- From the dropdown menu, select the default language of all component labels in the package.
- Optionally, choose a custom link from the Configure Custom Link field to display configuration information to installers of your app. You can select a predefined custom link to a URL or s-control that you’ve created for your home page layouts; see the Configure Option. The custom link displays as a Configure link within Salesforce on AppExchange Downloads page and app detail page of the installer's organization.
- Optionally, in the Notify on Apex Error field, enter the username of the person to notify if an uncaught exception occurs in the Apex code. If you don’t specify a username, all uncaught exceptions generate an email notification that is sent to Salesforce. This option is only available for managed packages.
- Optionally, in the Notify on Packaging Error field, enter the email address of the person who receives an email notification if an error occurs when a subscriber’s attempt to install, upgrade, or uninstall a packaged app fails. This field appears only if packaging error notifications are enabled. To enable notifications, contact your Salesforce representative.
- Optionally, enter a description that describes the package. You can change this description before you upload it to AppExchange.
- Optionally, specify a post install script. You can run an Apex script in the subscriber organization after the package is installed or upgraded. For more information, see Running Apex on Package Install/Upgrade.
- Optionally, specify an uninstall script. You can run an Apex script in the subscriber organization after the package is uninstalled. For more information, see Running Apex on Package Uninstall.
- Click Save.
- Salesforce sets your package API access privileges to Unrestricted. You can change this setting to further restrict API access of Salesforce components in the package. For more information, see Manage API and Dynamic Apex Access in Packages.
- Add the necessary components for your app.
- Click Add Components.
- From the dropdown list, choose the type of component you want to add to your
package.
- At the top of the list, click a letter to display the contents of the sorted column that begin with that character.
- If available, click the Next Page (or Previous Page) link to go to the next or previous set of components.
- If available, click fewer or more at the bottom of the list to view a shorter or longer display list.
- Select the components you want to add.
- Click Add To Package.
- Repeat these steps until you added all the components you want in your package.
- Optionally, click View Dependencies and review a list of components that rely on other components, permissions, or preferences within the package. An entity can include such things as an s-control, a standard or custom field, or an organization-wide setting like multicurrency. Your package can’t be installed unless the installer has the listed components enabled or installed. For more information on dependencies, see Understanding Dependencies. To return to the Package detail page, click Done.
- Click Upload.
- On the Upload Package page, do the following:
- Enter a Version Name. As a best practice, it's useful to have a short description and the date.
- Enter a Version Number for the upload, such as
1.0. The format is
majorNumber.minorNumber.
The version number represents a release of a package. This field is required for managed and unmanaged packages. For a managed package, the version number corresponds to a Managed - Released upload. All beta uploads use the same version number until you upload a Managed - Released package version with a new version number.
For example, the following is a sequence of version numbers for a series of uploads.
Upload Sequence Type Version Number Notes First upload Managed - Beta 1.0 The first Managed - Beta upload. Second upload Managed - Released 1.0 A Managed - Released upload. The version number doesn’t change. Third upload Managed - Released 1.1 Note the change of minor release number for the Managed - Released upload. Fourth upload Managed - Beta 2.0 The first Managed - Beta upload for version number 2.0. Note the major version number update. Fifth upload Managed - Released 2.0 A Managed - Released upload. The version number doesn’t change. -
For managed packages, select a Release
Type:
- Choose Managed - Released to upload an upgradeable version. After upload, some attributes of the metadata components are locked.
- Choose Managed - Beta if you want to upload a version of your package to a small sampling of your audience for testing purposes. You can still change the components and upload other beta versions.
- Change the Description, if necessary.
- (Optional) Specify a link to release notes for the package. Click URL and enter the details in the text field that appears. This link will be displayed during the installation process, and on the Package Details page after installation.
- (Optional) Specify a link to post install instructions for the package. Click URL or Visualforce page and enter the details in the text field that appears. This link will be displayed on the Package Details page after installation.
- (Optional) Enter and confirm a password to share the package privately with anyone who has the password. Don't enter a password if you want to make the package available to anyone on AppExchange and share your package publicly.
- Salesforce automatically selects the requirements it finds. In addition, select any other required components from the Package Requirements and Object Requirements sections to notify installers of any requirements for this package.
- Click Upload.
You receive an email that includes an installation link when your package has been uploaded successfully.
After your upload is complete you can do any of the following.
- To revert the Managed - Released package version back to Managed - Beta, click Revert to Beta.
- To change the password option, click Change Password link.
- To prevent new installations of this package while allowing existing installations
to continue operating, click Deprecate.
When you deprecate a package, remember to remove it from AppExchange as well.
- To make a deprecated version available for installation again, click Undeprecate.