Loading

Mass delete 'Paused and Waiting Interviews' records

Veröffentlichungsdatum: Jun 26, 2023
Beschreibung
When navigating to the "Paused and Waiting Interviews" (Click on Setup | Build | create | Workflows & Approvals | Flows or Setup | Process Automation | Flows) you may see that there are multiple records that have been created. When the limit is reached, you will see an unhandled process fault error. We can delete one Interview record at a time but this will take lot of time to delete all the records. 
Lösung
You can use Flow to solve this issue. Here are the steps to create the Flow:
  1. In LEX, go to Setup | Process Automation | Flows or in Classic, Setup | Build | create | Workflows & Approvals | Flows
  2. Click on New Flow, it will open the Lightning Flow Builder. Select Flow Type (Screen Flow or Autolaunched Flow). Drag-and-drop Delete Records Element on to the canvas and fill the details:
    • ​Enter Name and API Name.
    • Under How to Find Records to Delete select : Specify conditions
    • Under Delete Records of This Object Type, select FlowInterview and create a filter like InterviewLabel contains "API-Name-Of-The-Process". Please note that we are selecting "InterviewLabel" because it includes: API Name, Version Number and the Object Name. This allows you the flexibility to mass delete interviews of a specific version of a Process.
  3. Click Save. Enter the Flow Name and remember to Activate the Flow.
A few things to consider:
  • The filter you defined as part of the step #2 is what decides what Interview records are going to be removed from the "Paused and Waiting Interviews". Take your time and make sure you select the right filter (notice that you're using "Contains" in the example above), and include the version in the API name as necessary.
  • You may want to test this in a Sandbox first to make sure that it works as you expect without the risk of removing Interviews inadvertently. 
  • To delete a flow interview, you must have the “Manage Force.com Flow” user permission. All other calls require the “Run Flows” user permission or the Force.com Flow User field enabled on the user detail page.
Once the Flow has been created as per the steps above and after you made sure that the filter logic is what you desired you can Run the Flow to remove the Interviews.
In LEX, follow Setup | Process Automation | Flows and in Classic, Setup | Build | create | Workflows & Approvals | Flows. Click on the Flow that you created above, it will redirect you to the Flow Detail page.
There you can click on the "Run" button to execute the Flow. Please note this will immediately kick off the Flow and the Delete process

Another alternative would be to use the API (Data Loader, Workbench...).
The FlowInterview object is exposed and records can be deleted via API version 33.0 or above.

FlowInterview 
Nummer des Knowledge-Artikels

000388016

 
Laden
Salesforce Help | Article