User Story
As a Salesforce Administrator,
I want to create a screen flow that identifies and deletes the middle account(s) from a list of accounts created within a specified date range,
so that I can efficiently clean up data and ensure better account management.
Acceptance Criteria
Input Parameters
The screen flow must allow the user to input:
- Start Creation Date
- End Creation Date
Account Retrieval
- The flow must retrieve all accounts created within the specified date range and sort them by the creation date in ascending order.
Middle Account(s) Identification
- If the total number of accounts is odd, the flow should identify the middle account.
- If the total number of accounts is even, the flow should identify the two middle accounts.
Account Display and Confirmation
The flow must display the identified account(s) (e.g., Account Name and Created Date) to the user.
The flow must request user confirmation before proceeding with the deletion.
Deletion Process
Upon user confirmation, the flow should:
- Delete the identified account(s).
- Display a success message confirming the deletion.
No Accounts Found
- If no accounts are found within the specified date range:
- The flow should notify the user: “No accounts found within the specified date range.”
- Exit gracefully without attempting further actions.
Example Scenarios
-
16 Accounts Found:
- The flow identifies and deletes the 8th and 9th accounts in chronological order.
-
21 Accounts Found:
- The flow identifies and deletes the 11th account.
- 0 Accounts Found:
- The flow notifies the user: “No accounts found within the specified date range.”