Package2VersionCreateRequest

Represents a request to create a second-generation managed package or an unlocked package version in a Dev Hub org.

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 

AsyncValidation 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 61.0

  • Description: If true, a new package version is created before package validations complete.

The default value is false.

For more information on async validation, see Create and Update Versions of a Second-Generation Managed Package

  • Default value: false

Branch 

  • Type: string

  • Required: No

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

  • Description: The branch to associate with this package version. Can be used to create a tree structure of inheritance. Upon successful creation of a Package2Version, this value is copied to the package version’s Branch field.

The default value is null.

CalcTransitiveDependencies 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 65.0

  • Description: If true, the calculation of the package version’s indirect dependencies is enabled. A package can have multiple levels of dependencies, where pkgC depends on pkgB, and pkgB depends on pkgA, for example. By default, you list all of a package’s dependencies, including indirect (transitive) dependencies. When CalcTransitiveDependencies is set to true, you specify a package’s direct dependencies only, and the indirect dependencies are calculated for you. See Create Dependencies Between Second-Generation Managed Packages in the Second-Generation Managed Packaging Developer Guide.

CalcTransitiveDependencies also enables you to generate a hierarchical graph of a package version’s dependencies. To generate the dependencies graph, run the package version displaydependencies CLI command. See package version displaydependencies in the Salesforce CLI Command Reference.

The default value is false.

  • Default value: false

CalculateCodeCoverage 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 47.0

  • Description: If true, code coverage is calculated during package version creation. If false, code coverage isn’t calculated.

For second-generation managed packages, a minimum 75% code coverage is required for package version promotion.

  • Default value: false

DependencyGraphJson 

  • Type: textarea

  • Required: No

  • Properties: Create, Nillable, Update

  • Introduced: API version 65.0

  • Description: If CalcTransitiveDependencies is set to true, DependencyGraphJson is auto-populated with information about the package’s dependencies when you create a new package version.

If CalcTransitiveDependencies is false, the default value is null.

InstallKey 

  • Type: encryptedstring

  • Required: No

  • Properties: Create, Nillable

  • Introduced: API version 41.0

  • Description: Installation key for installing a key-protected package. The default is null.

Used only on insert. If you query for this value, null is always returned (for security reasons).

The default value is null.

IsConversionRequest 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 49.0

  • Description: If true, this package version is being converted from a first-generation managed package to a second-generation managed package.

The default value is false.

  • Default value: false

IsDevUsePkgZipRequested 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 63.0

  • Description: If true, a downloadable package zip file containing package metadata is generated when a new package version is created.

The default value is false.

  • Default value: false

IsPasswordProtected 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 41.0

  • Description: Specifies whether installation of this package version requires the user to provide an installation key (true) or not (false).

The default value is null.

  • Default value: false

Language 

  • Type: picklist

  • Required: No

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

  • Introduced: API version 57.0

  • Description: The language for the package. The picklist values match the Fully Supported Languages listed in Salesforce Help.

If no language is specified, the language defaults to the language of the Dev Hub user who created the package.

  • Possible values:

    • en_US — English

    • de — German

    • es — Spanish

    • fr — French

    • it — Italian

    • ja — Japanese

    • sv — Swedish

    • ko — Korean

    • zh_TW — Chinese (Traditional)

    • zh_CN — Chinese (Simplified)

    • pt_BR — Portuguese (Brazil)

    • nl_NL — Dutch

    • da — Danish

    • th — Thai

    • fi — Finnish

    • ru — Russian

    • es_MX — Spanish (Mexico)

    • no — Norwegian

Package2Id 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Sort

  • Description: A reference to an ID for the Package2 to create a version of.

The default value is null.

  • Relationship name: Package2
  • Relationship type: relationship
  • Refers to: Package2

Package2VersionId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: A reference to an ID for the Package2Version that this request creates (starts with 05i).

The default value is null.

  • Relationship name: Package2Version
  • Relationship type: relationship
  • Refers to: Package2Version

SkipValidation 

  • Type: boolean

  • Required: No

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

  • Introduced: API version 48.0

  • Description: If true, validation is skipped during package version creation. Skipping validation reduces the time it takes to create a new package version, but package versions created without validation can’t be promoted to the released state.

The default value is false.

You can’t specify both skip validation and code coverage, because code coverage is calculated during validation.

  • Default value: false

Status 

  • Type: picklist

  • Required: No

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

  • Description: The status of the Package2Version creation request. Valid values include:

The preceding values are listed in the order they appear during a Package2Version create request. The default value is null.

  • Possible values:

    • Queued — Queued

    • Initializing — Initializing

    • VerifyingFeaturesAndSettings — Verifying Features And Settings

    • VerifyingDependencies — Verifying Dependencies

    • VerifyingMetadata — Verifying Metadata

    • FinalizingPackageVersion — Finalizing PackageVersion

    • PerformingValidations — Performing Validations

    • Success — Success

    • Error — Error

    • Verifying Features and Settings — Verifying Features and Settings

    • Verifying Dependencies — Verifying Dependencies

    • Verifying Metadata — Verifying Metadata

    • Finalizing PackageVersion — Finalizing PackageVersion

Tag 

  • Type: string

  • Required: No

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

  • Description: Optional tags for the package version.

The default value is null.

VersionInfo 

  • Type: base64

  • Required: No

  • Properties: Create

  • Description: The blob that stores details about the package version.

The default value is null.

When you query Package2VersionCreateRequest, data from VersionInfo isn’t returned.

Note

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