MetadataPackageVersion
Represents a package version (managed or unmanaged) that has been uploaded from the org you’re logged in to.
Introduced in API version 36.0.
describeSObjects(), query(), retrieve()
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Description: The build number of the version. For example, if you upload two beta versions, they have build numbers 1 and 2. Then, when you upload a non-beta version, the build number is 3. When you upload a new version, the build number resets to 1.
- Type: boolean
- Properties: Defaulted on create, Filter, Group, Sort
- Introduced: API version 46.0
- Description: Indicates whether the package version is deprecated.
- Default value: false
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Description: The first number in a package version number. A version number either has an
x.yformat or anx.y.zformat. Thexrepresents the major version,ythe minor version, andzthe patch version.
- Type: reference
- Properties: Filter, Group, Nillable, Sort
- Description: The 18-character package ID starting with
033. - Relationship name: MetadataPackage
- Relationship type: relationship
- Refers to: MetadataPackage
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Description: The second number in a package version number. A version number either has an
x.yformat or anx.y.zformat. Thexrepresents the major version,ythe minor version, andzthe patch version.
- Type: string
- Properties: Filter, Group, idLookup, Sort
- Description: The name of the package version.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Description: The third number in a package version number, if present. A version number either has an
x.yformat or anx.y.zformat. Thexrepresents the major version,ythe minor version, andzthe patch version.
- Type: picklist
- Properties: Filter, Group, Nillable, Restricted picklist, Sort
- Description: If the package version is a beta version, the value is
Beta. Otherwise, the value isReleased.
Here are examples of the types of API queries you can perform.
| Query | String |
|---|---|
Get all package versions for the package that has a MetadataPackageID of 033D00000001xQlIAI | SELECT Id, Name, ReleaseState, MajorVersion, MinorVersion, PatchVersion FROM MetadataPackageVersion WHERE MetadataPackageId = '033D00000001xQlIAI' |
Get the package version for the package with a specific MetadataPackageID and a major version greater than 1 | SELECT Id FROM MetadataPackageVersion WHERE MetadataPackageId ='033D00000001xQlIAI' AND MajorVersion > 1 |
Get released package versions for the package with a specific MetadataPackageID | SELECT Id FROM MetadataPackageVersion WHERE MetadataPackageId = '033D00000001xQlIAI' AND ReleaseState = 'Released' |
Java Code Sample
Suppose you want to push version 3.4.6 of your package to all orgs. Let’s write some code to identify the orgs eligible for the upgrade. This example demonstrates how to generate the list of subscriber orgs eligible to be upgraded to version 3.4.6 of a package.
This code sample uses the Web Services Connector (WSC).
Next Step
Create a push request using PackagePushRequest.