Object Reference for the Salesforce Platform
Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
PackagePushError
Supported Calls
describeSObjects(), query(), retrieve()
Special Access Rules
To initiate a push upgrade for a first-generation managed package, the Upload AppExchange Packages user permission is required.
To initiate a push upgrade for an unlocked or second-generation managed package, the Create and Update Second-Generation Packages user permission is required.
The push upgrade feature is only available to first- and second-generation managed packages that have passed AppExchange security review. To enable push upgrades for your managed package, log a support case in the Salesforce Partner Community.
For unlocked packages, push upgrades are enabled by default.
Fields
| Field Name | Details |
|---|---|
| ErrorDetails |
|
| ErrorMessage |
|
| ErrorSeverity |
|
| ErrorTitle |
|
| ErrorType |
|
| PackagePushJobId |
|
Usage
Suppose that your push upgrade request wasn’t successful due to some of its jobs failing. Let’s write some code to find out what those errors were.
1// Retrieves all PackagePushError objects associated with the PackagePushJob with the given
2// ID
3final String PACKAGE_PUSH_ERROR_QUERY = "Select ErrorMessage, ErrorDetails, ErrorTitle,"
4+ " ErrorSeverity, ErrorType from PackagePushError where PackagePushJobId = '%s'";
5
6// job is a PackagePushJob instance
7QueryResult queryResult = conn.query(String.format(PACKAGE_PUSH_ERROR_QUERY, job.getId()));
8
9StringBuilder errorMessages = new StringBuilder();
10errorMessages.append("Errors for PackagePushJob [").append(job.getId()).append("]:")
11 .append("\n");
12
13// There can be multiple PackagePushErrors for a given PackagePushJob
14for(SObject r : queryResult.getRecords()) {
15 PackagePushError e = (PackagePushError) r;
16 errorMessages.append("Title: ").append(e.getErrorTitle()).append("\n");
17 errorMessages.append("Severity: ").append(e.getErrorSeverity()).append("\n");
18 errorMessages.append("Type: ").append(e.getErrorType()).append("\n");
19 errorMessages.append("Message: ").append(e.getErrorMessage()).append("\n");
20 errorMessages.append("Details: ").append(e.getErrorDetails()).append("\n");
21 errorMessages.append("\n");
22}
23
24String errors errorMessages.toString();