---
schema_version: "1"
id: de7156a121765f6a0893853d182cdfb1536eb00dfc853d4a23aec961f98c42c2
title: ProcessRequest Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_ProcessRequest.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ProcessRequest.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6d3c2431a1dc58d4b8d1bec2a6c1becb60b43125dd893dd310c659e93d488d66
description: The ProcessRequest class is the parent class for the ProcessSubmitRequest and ProcessWorkitemRequest classes. Use the ProcessRequest class to write generic Apex that can process objects from either class.Returns the comments that have been added previously to the approval request.Returns the list of user IDs of user specified as approvers.Sets the comments to be added to the approval request.If the next step in your approval process is another Apex approval process, you specify exactly one user ID as the next approver. If not, you cannot specify a user ID and this method must be null. This method sets the ActorId field of the associated ProcessInstanceWorkItem.
---
# ProcessRequest Class

The ProcessRequest class is the parent class for the ProcessSubmitRequest and ProcessWorkitemRequest classes. Use the ProcessRequest class to write generic Apex that can process objects from either class.

## Namespace

[Approval](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Approval.htm "The Approval namespace provides classes and methods for approval processes.")

## Usage

The request must be instantiated via the child classes, ProcessSubmitRequest and ProcessWorkItemRequest.

## ProcessRequest Methods

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

- **[getComments()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ProcessRequest.htm#apex_Approval_ProcessRequest_getComments)**  
    Returns the comments that have been added previously to the approval request.
- **[getNextApproverIds()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ProcessRequest.htm#apex_Approval_ProcessRequest_getNextApproverIds)**  
    Returns the list of user IDs of user specified as approvers.
- **[setComments(comments)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ProcessRequest.htm#apex_Approval_ProcessRequest_setComments)**  
    Sets the comments to be added to the approval request.
- **[setNextApproverIds(nextApproverIds)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ProcessRequest.htm#apex_Approval_ProcessRequest_setNextApproverIds)**  
    If the next step in your approval process is another Apex approval process, you specify exactly one user ID as the next approver. If not, you cannot specify a user ID and this method must be null. This method sets the ActorId field of the associated ProcessInstanceWorkItem.

### getComments()

Returns the comments that have been added previously to the approval request.

#### Signature

public String getComments()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getNextApproverIds()

Returns the list of user IDs of user specified as approvers.

#### Signature

public ID\[\] getNextApproverIds()

#### Return Value

Type: [ID](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm#apex_methods_system_id "Contains methods for the ID primitive data type.")\[\]

### setComments(comments)

Sets the comments to be added to the approval request.

#### Signature

public Void setComments(String comments)

#### Parameters

- **comments**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Return Value

Type: Void

### setNextApproverIds(nextApproverIds)

If the next step in your approval process is another Apex approval process, you specify exactly one user ID as the next approver. If not, you cannot specify a user ID and this method must be null. This method sets the ActorId field of the associated ProcessInstanceWorkItem.

#### Signature

public Void setNextApproverIds(ID\[\] nextApproverIds)

#### Parameters

- **nextApproverIds**: Type: [ID](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm#apex_methods_system_id "Contains methods for the ID primitive data type.")\[\] Must be a single-entry list.

#### Return Value

Type: Void