Newer Version Available

This content describes an older version of this product. View Latest

Scheduling Push Upgrades

After you’ve created an updated version of your package, you can automatically deploy it to customers using a push upgrade.

User Permissions Needed
To push an upgrade: Upload AppExchange Packages
  1. Push the upgrade to your own orgs so you can run tests and fix any bugs before upgrading subscribers.
  2. When you’re ready and have coordinated with your customers on their change management process, push to a small number of customer organizations. Try sandbox organizations first, if possible.
  3. After you’re comfortable with the initial results, push to your wider customer base, based on your agreements with each customer.
  4. Deprecate the previous version of your package in your main development organization. Replace the version on AppExchange if necessary, and update your Trialforce setup.
  5. If your upgrade was a patch, after you’ve successfully distributed the upgrade to subscriber organizations, reintegrate those changes into your main development organization. For more information about combining patches in the main development organization, see Working with Patch Versions.

Partners can also grant select customers the ability to block push upgrades by setting up customized push upgrades. See Enable a Package Subscriber to Restrict Push Upgrades for more information.

Note

Schedule a Push Upgrade Using the UI

Only first-generation managed packages can schedule a push upgrade using the UI. To schedule a push upgrade for unlocked and second-generation managed packages, use the PackagePushRequest in the Salesforce Object Reference.

Note

  1. Log in to your main development org (not the patch org you used to upload the new version).
  2. From Setup, enter Packages in the Quick Find box, then select Packages.
  3. Click the name of the managed package whose upgrade you want to push.
  4. On the package detail page, click the Versions tab, and then click Push Upgrades.
  5. Click Schedule Push Upgrades.
  6. Select a package version to push from the Patch Version dropdown list.

    Beta versions aren’t eligible for push.

    Note

  7. For the scheduled start date, enter when you want the push upgrade to begin.

    Scheduled push upgrades begin as soon as resources are available on the Salesforce instance, which is either at or after the start time you specify. In certain scenarios, the push upgrade could start a few hours after the scheduled start time.

    Note

  8. In the Select Target Organizations section, select the orgs to receive your push upgrade. If an org already received a push upgrade for the selected package version, it doesn’t appear in this list. You can select orgs by:
    • Entering a term that filters based on an org’s name or ID. Names can match by partial string, but IDs must match exactly.
    • Choosing between production and sandbox orgs from the Organizations dropdown list.
    • Choosing orgs that have already installed a particular version.
    • Clicking individual orgs or the Select All and Deselect All checkboxes.
    This section lists the following information about the org (in alphabetical order):
    Field Description
    Current Version The current package version an organization has installed.
    Organization ID The ID of the org.
    Organization Name The name of the org. To view the upgrade history for the org, click the org name.
    Primary Contact The name of the user who installed the package.
  9. Click Schedule. While a push upgrade is in progress, you can click Abort to stop it.

Schedule a Push Upgrade Using the Enterprise API

  1. Authenticate to your main development org (not the patch org you used to upload the new version).
  2. Determine the package version you want to upgrade subscribers to by querying the MetadataPackageVersion object.
  3. Gather the list of subscriber orgs that are eligible to be upgraded by querying the PackageSubscriber object.

    If you’re retrieving more than 2,000 subscribers, use SOAP API queryMore() call.

    Note

  4. Create a PackagePushRequest object. PackagePushRequest objects take a PackageVersionId and, optionally, a ScheduledStartTime parameter to specify when the push begins. If you omit the ScheduledStartTime, the push begins when you set the PackagePushRequest's status to Pending.
  5. Create a PackagePushJob for each eligible subscriber and associate it with the PackagePushRequest you created in the previous step.
  6. Schedule the push upgrade by changing the status of the PackagePushRequest to Pending.
  7. Check the status of the PackagePushRequest and PackagePushJob objects by querying the Status fields. If the status is either Created or Pending, you can abort the push upgrade by changing the status of the PackagePushRequest to Canceled. You can’t abort a push upgrade that has a status of Canceled, Succeeded, Failed, or In Progress.

    If you’re pushing the upgrade to more than 2,000 subscribers, use the Bulk_API to process the job in batches.

    Note

For sample code and more details, see SOAP API Developer Guide.