Package2

Represents a second-generation managed package or an unlocked package in a Dev Hub org. Values for all fields are visible to the subscriber.

Version 

Introduced in API version 40.0.

Supported SOAP API Calls 

create(), describeSObjects(), query(), retrieve(), update(), upsert()

Supported REST API Methods 

GET, HEAD, PATCH, POST, Query

Fields 

AppAnalyticsEnabled 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort, Update

  • Introduced: API version 59.0

  • Description: If true AppExchange App Analytics can access package usage logs and subscriber snapshots.

The default value is false.

  • Default value: false

ContainerOptions 

  • Type: picklist

  • Required: No

  • Properties: Create, Filter, Group, Restricted picklist, Sort

  • Introduced: API version 41.0

  • Description: Container options for the second-generation package. These options determine the upgrade and editability rules. The default value is Managed.

Valid values include:

  • Possible values:

    • Managed — Managed

    • Unlocked — Unlocked

    • Locked — Locked

ConvertedFromPackageId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort

  • Introduced: API version 49.0

  • Description: The package ID (starts with 033) for the first-generation managed package that was converted.

This field is a relationship field.

  • Relationship name: ConvertedFromPackage
  • Relationship type: relationship
  • Refers to: SubscriberPackage

DataCloudPackage 

  • Type: boolean

  • Required: No

  • Properties: Create, Defaulted on create, Filter, Group, Sort

  • Introduced: API version 60.0

  • Description: If true, this package contains metadata. When creating a managed package with metadata, you must isolate the metadata from the other Salesforce metadata by creating a separate package that contains only metadata.

Then create a package dependency between your dedicated package and any related packages.

The default value is false.

  • Default value: false

Description 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Nillable, Sort, Update

  • Description: Description of the package.

DistributionType 

  • Type: string
  • Required: No
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Introduced: API version 68.0

IsDeprecated 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort, Update

  • Introduced: API version 43.0

  • Version: Deprecated package versions that have been installed in subscriber orgs continue to function, but new installations of deprecated package versions are blocked.

  • Description: Specifies whether this package has been marked as deprecated (true) or not (false). The default value is false.

If you set IsDeprecated to true for a package, the package and all of its child package versions are deprecated.

If you set IsDeprecated to false for a package, the package and all of its child package versions are undeprecated. However, if IsDeprecated is explicitly set to true for a package version after its parent package is deprecated, the child remains deprecated even if you undeprecate its parent.

If you set IsDeprecated to false for a package version whose parent package is deprecated, the package version’s IsDeprecated value remains true until its parent is undeprecated.

  • Default value: false

IsOrgDependent 

  • Type: boolean

  • Required: No

  • Properties: Create, Defaulted on create, Filter, Group, Sort

  • Introduced: API version 49.0

  • Description: Indicates whether the package depends on unpackaged metadata in the installation org (true) or not (false). This field only applies to unlocked packages. The default value is false.

  • Default value: false

Name 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Description: Name of the package. Unlike a typical developer name, this value is mutable and can contain special characters.

NamespacePrefix 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort

  • Description: Namespace prefix that identifies the components of your package in the subscriber’s org.

PackageErrorUsername 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Introduced: API version 50.0

  • Description: The email address for an active user in the Dev Hub org you want to receive email notification regarding package-related errors. You can set the field when creating a package and update it later.

RecommendedVersionId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Introduced: API version 66.0

  • Relationship name: RecommendedVersion

  • Relationship type: relationship

  • Refers to: SubscriberPackageVersion

SubscriberPackageId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Sort

  • Relationship name: SubscriberPackage

  • Relationship type: relationship

  • Refers to: SubscriberPackage

WasTransferred 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort

  • Introduced: API version 57.0

  • Description: Indicates whether the package was previously associated with a different Dev Hub org. For details, see: Transfer a Second-Generation Managed Package to a Different Dev Hub. The default value is false.

  • Default value: false

Usage 

Subscribers install package versions (Package2Versions) in their orgs.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!