ProcessResult Class
After you submit a record for approval, use the ProcessResult class to process the results of an approval process.
A ProcessResult object is returned by the process method. You must specify the Approval namespace when creating an instance of this class. For example:
The following are methods for ProcessResult. All are instance methods.
-
The ID of the record being processed.
-
If an error occurred, returns an array of one or more database error objects including the error code and description.
-
The ID of the approval process that has been submitted for approval.
-
The status of the current approval process. Valid values are: Approved, Rejected, Removed or Pending.
-
The IDs of the new items submitted to the approval process. There can be 0 or 1 approval processes.
-
A Boolean value that is set to
trueif the approval process completed successfully; otherwise, it is set tofalse.
The ID of the record being processed.
public String getEntityId()
Type: String
If an error occurred, returns an array of one or more database error objects including the error code and description.
public Database.Error[] getErrors()
Type: Database.Error[]
The ID of the approval process that has been submitted for approval.
public String getInstanceId()
Type: String
The status of the current approval process. Valid values are: Approved, Rejected, Removed or Pending.
public String getInstanceStatus()
Type: String
The IDs of the new items submitted to the approval process. There can be 0 or 1 approval processes.
public ID[] getNewWorkitemIds()
Type: ID[]
A Boolean value that is set to true if the approval process completed successfully; otherwise, it is set to false.
public Boolean isSuccess()
Type: Boolean