Skip to content

Skip Participant Action

Roles:
Salesforce AdministratorSalesforce Developer

Skipping (deferring) a participant action can be done either via a Flow invocable or through Apex. This API endpoint allows you to programmatically defer (skip) participant actions.

If the custom setting Throw exceptions = true, an exception is thrown when there is an error. If the setting is false, the error message is returned in the result.

Flow Invocable Action

Within the flow editor:

  1. Create a flow variable ParticipantIds with Data Type: Text and Allow multiple values (collection) = true
  2. Add a new element of type Action
  3. In Search Actions, search for: Skip Participant Action

Parameters

  • Label: Your Label
  • API Name: Your API Name
  • Action Name: Your Action Name
  • participantActionId: Salesforce Id of the Participant Action
  • participantActionIds: List of Participant Action IDs
Either participantActionId or participantActionIds is required.

Result

  • errorMessage: String
  • participantActionId: Id
  • success: boolean
  • successfulIds: List
  • errors: List

Apex Implementation

// Skip a list of participant actions
List<Id> participantActionIds = new List<Id>{ '<participantActionId1>', '<participantActionId2>' };

// Create request
RDNACadence.SkipParticipantAction.SkipActionRequest request = 
    new RDNACadence.SkipParticipantAction.SkipActionRequest();
request.participantActionIds = participantActionIds;

// Call the service
List<RDNACadence.SkipParticipantAction.SkipActionResult> results = 
    RDNACadence.SkipParticipantAction.skipParticipantActions(
        new List<RDNACadence.SkipParticipantAction.SkipActionRequest>{ request }
    );

// Process results
if (!results.isEmpty()) {
    RDNACadence.SkipParticipantAction.SkipActionResult result = results[0];
    if (result.success) {
        System.debug('Successfully skipped participant actions: ' + result.participantActionIds);
    } else {
        System.debug('Failed to skip participant action: ' + result.errorMessage);
    }
    System.debug(result);
}

Example with Error Handling

try {
    // Skip a list of participant actions
    List<Id> participantActionIds = new List<Id>{ '<participantActionId1>', '<participantActionId2>' };

    // Create request
    RDNACadence.SkipParticipantAction.SkipActionRequest request = 
        new RDNACadence.SkipParticipantAction.SkipActionRequest();
    request.participantActionIds = participantActionIds;

    // Call the service
    List<RDNACadence.SkipParticipantAction.SkipActionResult> results = 
        RDNACadence.SkipParticipantAction.skipParticipantActions(
            new List<RDNACadence.SkipParticipantAction.SkipActionRequest>{ request }
        );

    // Process results
    if (!results.isEmpty()) {
        RDNACadence.SkipParticipantAction.SkipActionResult result = results[0];
        if (result.success) {
            System.debug('Successfully skipped participant actions: ' + result.participantActionIds);
        } else {
            System.debug('Failed to skip participant action: ' + result.errorMessage);
        }
        System.debug(result);
    }
} catch (Exception e) {
    System.debug('Exception occurred: ' + e.getMessage());
}

Result Object

The SkipActionResult object contains:

  • success: Boolean indicating if the action was skipped successfully
  • participantActionId: The ID of the skipped participant action
  • participantActionIds: List of successfully skipped participant action IDs
  • errorMessage: Error message if the skip operation failed
  • successfulIds: List of successfully skipped participant action IDs
  • errors: List of error messages
Last updated on