No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
PackageVersionHeader
Specifies the package version for each installed managed package. A package version is a number that identifies the set of components uploaded in a package. The version number has the format majorNumber.minorNumber.patchNumber (for example, 2.1.3). The major and minor numbers increase to a chosen value during every major release. The patchNumber is generated and updated only for a patch release. As well as a set of components, a package version encompasses specific behavior. Publishers can use package versions to evolve the components in their managed packages gracefully by releasing subsequent package versions without breaking existing customer integrations using the 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 is not specified for a package, the API client uses the version of the package that is selected in the Version Settings section under Setup, in . This header is available in API version 16.0 and later.
Associated API Calls
convertLead(), create(), delete(), describeGlobal(), describeLayout(), describeSObject(), describeSObjects(), describeSoftphoneLayout(), describeTabs(), merge(), process(), query(), retrieve(), search(), undelete(), update(), upsert()
Fields
| Element Name | Type | Description |
|---|---|---|
| packageVersions | PackageVersion[] | A list of package versions for installed managed packages referenced by your API client. |
PackageVersion
Specifies a version of an installed managed package. It includes the following fields:
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.
1swfobject.registerObject("clippy.codeblock-0", "9");public void PackageVersionHeaderSample(String code) throws Exception
2{
3 _PackageVersionHeader pvh = new _PackageVersionHeader();
4 PackageVersion pv = new PackageVersion();
5 pv.setNamespace("installedPackageNamespaceHere");
6 pv.setMajorNumber(1);
7 pv.setMinorNumber(0);
8 // In this case, we are only referencing one installed package.
9 PackageVersion[] pvs = new PackageVersion[]{pv};
10 pvh.setPackageVersions(pvs);
11
12 apexBinding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),
13 "PackageVersionHeader", pvh);
14 // Execute the code passed into the method.
15 ExecuteAnonymousResult r = apexBinding.executeAnonymous(code);
16 if (r.isSuccess()) {
17 System.out.println("Code executed successfully");
18 }
19 else {
20 System.out.println("Exception message: " + r.getExceptionMessage());
21 System.out.println("Exception stack trace: " + r.getExceptionStackTrace());
22 }
23}