Complete Participant Action
Roles:
Salesforce AdministratorSalesforce Developer
Completing a participant action can be done either via a Flow invocable or through Apex. This API endpoint allows you to programmatically mark participant actions as complete.
If the custom setting
Flow Invocable Action
Within the flow editor:
- Create a flow variable ParticipantIds with Data Type: Text and Allow multiple values (collection) = true
- Add a new element of type Action
- In Search Actions, search for: Complete 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
// Complete a list of participant actions
List<Id> participantActionIds = new List<Id>{ '<participantActionId1>', '<participantActionId2>' };
// Create request
RDNACadence.CompleteParticipantAction.CompleteActionRequest request =
new RDNACadence.CompleteParticipantAction.CompleteActionRequest();
request.participantActionIds = participantActionIds;
// Call the service
List<RDNACadence.CompleteParticipantAction.CompleteActionResult> results =
RDNACadence.CompleteParticipantAction.completeParticipantActions(
new List<RDNACadence.CompleteParticipantAction.CompleteActionRequest>{ request }
);
// Process results
if (!results.isEmpty()) {
RDNACadence.CompleteParticipantAction.CompleteActionResult result = results[0];
if (result.success) {
System.debug('Successfully completed participant actions: ' + result.participantActionIds);
} else {
System.debug('Failed to complete participant action: ' + result.errorMessage);
}
System.debug(result);
}Example with Error Handling
try {
// Complete a list of participant actions
List<Id> participantActionIds = new List<Id>{ '<participantActionId1>', '<participantActionId2>' };
// Create request
RDNACadence.CompleteParticipantAction.CompleteActionRequest request =
new RDNACadence.CompleteParticipantAction.CompleteActionRequest();
request.participantActionIds = participantActionIds;
// Call the service
List<RDNACadence.CompleteParticipantAction.CompleteActionResult> results =
RDNACadence.CompleteParticipantAction.completeParticipantActions(
new List<RDNACadence.CompleteParticipantAction.CompleteActionRequest>{ request }
);
// Process results
if (!results.isEmpty()) {
RDNACadence.CompleteParticipantAction.CompleteActionResult result = results[0];
if (result.success) {
System.debug('Successfully completed participant actions: ' + result.participantActionIds);
} else {
System.debug('Failed to complete participant action: ' + result.errorMessage);
}
System.debug(result);
}
} catch (Exception e) {
System.debug('Exception occurred: ' + e.getMessage());
}Result Object
The CompleteActionResult object contains:
- success: Boolean indicating if the action was completed successfully
- participantActionId: The ID of the completed participant action
- participantActionIds: List of successfully completed participant action IDs
- errorMessage: Error message if the completion failed
- successfulIds: List of successfully completed participant action IDs
- errors: List of error messages
Last updated on