Specifies the package version for each installed managed package.
A managed package can have several versions with different content and behavior. This header allows you to specify the version used for each package referenced by your API client.
If a package version isn’t specified, the API client uses the version of the package specified in Setup. From Setup, enter API in the Quick Find box, select API, and then click Configure Enterprise Package Version Settings under Enterprise Package Version Settings.
This header is available in API version 16.0 and later.
Description: A list of package versions for installed managed packages referenced by your API client.
PackageVersion
Specifies a version of an installed managed package. A package version is majorNumber.minorNumber, for example 2.1.
majorNumber
Type: int
Description: The major version number of a package version.
minorNumber
Type: int
Description: The minor version number of a package version.
namespace
Type: string
Description: The unique namespace of the managed package.
Sample Code—Java
This sample sets the package version for one installed package in the PackageVersionHeader. Next, it executes the code passed into this method via the executeAnonymous Apex method.