ProcessResult Class

After you submit a record for approval, use the ProcessResult class to process the results of an approval process.

Approval

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.

  • getEntityId()

    The ID of the record being processed.

  • getErrors()

    If an error occurred, returns an array of one or more database error objects including the error code and description.

  • getInstanceId()

    The ID of the approval process that has been submitted for approval.

  • getInstanceStatus()

    The status of the current approval process. Valid values are: Approved, Rejected, Removed or Pending.

  • getNewWorkitemIds()

    The IDs of the new items submitted to the approval process. There can be 0 or 1 approval processes.

  • isSuccess()

    A Boolean value that is set to true if the approval process completed successfully; otherwise, it is set to false.

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