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.

ProcessWorkitemRequest Class

Use the ProcessWorkitemRequest class for processing an approval request after it is submitted.

Namespace

Approval

Usage

You must specify the Approval namespace when creating an instance of this class. The constructor for this class takes no arguments. For example:

1Approval.ProcessWorkitemRequest pwr = new Approval.ProcessWorkitemRequest();

Inherited Methods

In addition to the methods listed, the ProcessWorkitemRequest class has access to all the methods in its parent class, ProcessRequest Class:

ProcessWorkitemRequest Methods

The following are methods for ProcessWorkitemRequest. All are instance methods.

getAction()

Returns the type of action already associated with the approval request. Valid values are: Approve, Reject, or Removed.

Signature

public String getAction()

Return Value

Type: String

getWorkitemId()

Returns the ID of the approval request that is in the process of being approved, rejected, or removed.

Signature

public String getWorkitemId()

Return Value

Type: String

setAction(actionType)

Sets the type of action to take for processing an approval request.

Signature

public Void setAction(String actionType)

Parameters

  • actionType: Type: String Valid values are: Approve, Reject, or Removed. Only system administrators can specify Removed.

Return Value

Type: Void

setWorkitemId(id)

Sets the ID of the approval request that is being approved, rejected, or removed.

Signature

public Void setWorkitemId(String id)

Parameters

Return Value

Type: Void