Salesforce Bulk Delete Tool with Web UI
npm install sf-bulk-delete> A powerful Node.js CLI tool with a beautiful web interface for bulk deleting Salesforce records using the Salesforce CLI.
- 🎨 Beautiful Dark/Light Theme UI with Tailwind CSS
- 📊 Three-Panel Layout with resizable splitters
- 🔍 Advanced Data Table with search, sorting, and pagination
- 📁 Multiple Object Support via load-plan.json
- ✅ Bulk Selection with checkbox management
- 📥 CSV Export functionality
- ⚠️ Safe Deletion with confirmation dialogs
- 📈 Real-time Job Monitoring with success/failure reports
- 🔄 Auto-refresh job status polling
- !sf-delete-1
- !sf-delete-2
- !sf-delete-3
- Node.js 14.x or higher
- Salesforce CLI (sf) installed and configured
- Authenticated Salesforce org
``bash
npm install -g sf-bulk-delete
`
`bash
sf-bulk-delete start -o myorg@example.com \
-p 7070 \
-l ./load-plans/load-plan-account.json
`
- -o, --org - Required: Salesforce org username or alias-p, --port
- - Port number for web server (default: 3000)-l, --load-plan
- - Path to load-plan.json (default: load-plan.json)
The load-plan.json file defines the Salesforce objects and queries for deletion. Here's the format:
`json`
[
{
"object": "Account",
"compositeKeys": [
"Id"
],
"query": "SELECT Name FROM Account",
"fieldMappings": {
"Name": "Name",
"Id": "Id"
}
}
]
json
[
{
"object": "Fruit__c",
"compositeKeys": [
"External_Id__c"
],
"query": "SELECT Name, Qty__c,External_Id__c FROM Fruit__c",
"fieldMappings": {
"Name": "Name",
"Qty__c": "Qty__c",
"External_Id__c": "External_Id__c"
}
}
]
`$3
Web Interface Guide
$3
- Displays all objects from load-plan.json
- Click an object to load its query
- Active object is highlighted$3
1. Query Editor: View and edit SOQL queries, auto-completes with fields for the selected object
2. Execute Button: Run the query (inserts Id field if not provided)
3. Search Box: Filter results in real-time
4. Data Table:
- Click column headers to sort
- Select records with checkboxes
- Hover for row highlighting
5. Pagination Controls: Navigate through large result sets
6. Export CSV: Download filtered results
7. Delete Selected: Initiate bulk delete operation$3
- Shows active and completed deletion jobs
- Real-time status updates
- Success/failure record lists
- Detailed job informationDeletion Workflow
1. Select Object: Click an object in the left panel
2. Execute Query: Click "Execute Query" to fetch records
3. Filter/Search: Optionally filter records
4. Select Records: Use checkboxes to select records for deletion
5. Initiate Delete: Click "Delete Selected"
6. Confirm: Review and confirm the deletion warning
7. Monitor: Watch the job progress in the right panel
8. Review Results: Check success/failure reports
API Endpoints
The tool exposes the following REST API endpoints:
-
GET /api/objects - Get all objects from load-plan
- POST /api/query - Execute SOQL query
- POST /api/delete - Delete records
- GET /api/results/:jobId - Get job resultsSafety Features
- ⚠️ Confirmation Dialog: Always prompts before deletion
- 🔍 Record Preview: Shows exactly what will be deleted
- 📊 Job Tracking: Monitor deletion progress
- 📝 Result Reports: Detailed success/failure logs
- 🛡️ Error Handling: Graceful error messages
Technical Details
$3
1. Tool creates a CSV file with record IDs
2. Executes:
sf data delete bulk --sobject