Rejection API

The DE Apex API includes methods to call the DE rejection functionality programmatically.

Reject Assignment

global static void n2de.GlobalAPIReject.rejectAssignment(Id recordId, String reason)

Perform a single rejection with given reason.


n2de.GlobalAPIReject.rejectAssignment(theId, 'The reason');


Reject Assignments

global static void n2de.GlobalAPIReject.rejectAssignments(List<n2de.RejectRequestDTO> rejectRequests)

Perform multiple rejections with given reasons.


List<n2de.RejectRequestDTO> rejectRequests = List<n2de.RejectRequestDTO>();
rejectRequests.add(new n2de.RejectRequestDTO(theId, 'The reason'));
rejectRequests.add(new n2de.RejectRequestDTO(anotherId, 'Another reason'));


When rejecting one or more assignments the following needs to be considered:

  • The recordId and reason are always required
  • If reject reason options have been defined in Distribution Settings, the reason must be in that list, unless 'allow custom reasons' has also been selected
  • When rejecting multiple records a maximum of 500 can be provided in one call
  • The recordId must point to a valid record and the associated distribution log must exist
  • If configured, the user must be within their rejection request limit
This method is also available to use within a Salesforce Flow under the name "DE Reject Record" in the category "Distribution Engine". An example of using it can be found in the Custom Assignment Rejection article.

How did we do?

DE Apex API Introduction

System API