A comprehensive Python desktop application for exporting, managing, and analyzing Salesforce metadata with an intuitive graphical interface.
- Overview
- Key Features
- Installation
- Quick Start Guide
- Feature Modules
- Project Structure
- Configuration
- Troubleshooting
- Building Executable
- Contributing
Salesforce Metadata Exporter is a powerful desktop application for Salesforce metadata management, data extraction, and automation control. Built with Python and CustomTkinter for DevOps engineers, Salesforce administrators, and data analysts.
- Python: 3.10 or higher
- OS: Windows 10+, macOS 10.14+, Linux (Ubuntu 20.04+)
- RAM: 4 GB minimum (8 GB recommended)
- Salesforce: API access with appropriate permissions
- Production, Sandbox, and Custom Domain support
- Optional security token (IP whitelisting)
- Session management with reconnection
- Picklist Exporter → Excel with active/inactive status
- Metadata Exporter → CSV with field usage tracking across 13+ metadata types
- ContentDocument Downloader → Bulk file download with metadata
- SOQL Query Runner → Interactive queries with smart autocomplete
- Salesforce Switch → Bulk enable/disable automation (Validation Rules, Workflows, Flows, Triggers)
- Report Exporter → Native Excel export preserving ALL formatting (groupings, subtotals, colors)
- Concurrent Downloads: 10+ parallel operations
- Virtual Scrolling: Handle 10,000+ items without lag
- Batch Processing: Smart retry logic with exponential backoff
- Progress Tracking: Real-time ETA and speed metrics
Windows:
python -m venv venv
venv\Scripts\activatemacOS/Linux:
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtRequired Packages:
customtkinter- Modern GUI frameworksimple-salesforce- Salesforce API wrapperrequests- HTTP libraryopenpyxl- Excel file operationsdarkdetect- System theme detectionpsutil- System monitoring
python main.pyProduction/Sandbox:
- Select org type
- Enter username, password, security token
- Click "Login to Salesforce"
Custom Domain (My Domain):
- Check "🌐 Use Custom Domain"
- Enter domain (e.g.,
mycompany.my.salesforce.com) - Enter credentials
💡 Tip: Leave security token blank if your IP is whitelisted.
1. Select objects (Account, Contact, etc.)
2. Click "Export Picklist Data"
3. Choose save location → Excel file created
Output: Object, Field Label, Field API, Picklist Value Label, Value API, Status
1. Select objects
2. Click "Export Metadata"
3. Wait for usage analysis (~1-2 minutes)
4. Review CSV with "Field Usage" column
Field Usage Tracks: Page Layouts, Validation Rules, Workflows, Flows, Apex Classes, Triggers, Visualforce Pages, Lightning Components, Email Templates, Custom Buttons
1. Click "Download Files" (no selection needed)
2. Choose save location
3. Files download to Documents/ subfolder
4. CSV metadata created
1. Click "Run SOQL"
2. Type query: SELECT Id, Name FROM Account
3. Press Ctrl+Space for field suggestions
4. Press Ctrl+Enter to execute
5. Export results to CSV
⚠️ CRITICAL: Triggers take 5-15 minutes (runs all Apex tests)
1. Click "Salesforce Switch"
2. Wait for components to load
3. Search/filter components
4. Select components or click "DISABLE ALL"
5. Click "🚀 DEPLOY CHANGES"
6. Use "🔄 ROLLBACK" to undo before deployment
1. Click "📊 Report Export"
2. Search reports by keyword
3. Select reports (individual or entire folders)
4. Choose format: Excel (.xlsx) or CSV
5. Click "🚀 EXPORT REPORTS"
6. Monitor progress with ETA
7. Cancel anytime (saves partial exports)
Excel Format: Preserves groupings, subtotals, grand totals, formatting, merged cells (same as Salesforce UI)
salesforce-metadata-exporter/
│
├── main.py # Entry point
├── gui.py # Main GUI (login, export)
├── config.py # Configuration
├── requirements.txt # Dependencies
│── salesforce_client.py # Authentication
│── threading_helper.py # Background threads
│── utils.py # Utilities
│── picklist_exporter.py # Picklist export
│── metadata_exporter.py # Metadata export
│── content_document_exporter.py # File downloads
│── field_usage_tracker.py # Usage analysis
│── soql_runner.py # Query execution
│── soql_query_frame.py # SOQL UI
│── metadata_switch_manager.py # Component manager
│── salesforce_switch_frame.py # Switch UI
│── trigger_deployer.py # Trigger deployment
└── Report Exporter/
├── main_app.py # Report UI
├── exporter.py # Export engine
└── virtual_tree.py # Virtual scrolling
Total Lines of Code: ~9,100 lines across 20+ modules
API_VERSION = '65.0' # Salesforce API version
WINDOW_GEOMETRY = "1200x800" # Default window size
APPEARANCE_MODE = "System" # Light/Dark/System# Set custom API version
export SF_API_VERSION="62.0"
# Set default org type
export SF_ORG_TYPE="Production""Custom Domain Not Found"
- ✅ Check domain spelling (no
https://) - ✅ Ensure My Domain is active in Salesforce
- ✅ Use format:
mycompany.my.salesforce.com
"Invalid Username or Password"
- ✅ Verify credentials in Salesforce
- ✅ Check if account is locked
- ✅ Try resetting password
"Security Token Required"
- ✅ Get token: Setup → My Personal Information → Reset Security Token
- ✅ Or whitelist your IP in Salesforce
"Some objects failed to export"
- Objects may require specific permissions
- Check status log for details
- Verify object API names
"Field usage tracking incomplete"
- Large orgs may timeout
- Partial results are still saved
- Re-run for specific objects
"Application slow with 10,000+ reports"
- ✅ Use search to filter results
- ✅ Select fewer reports per export
- ✅ Use CSV format (faster than Excel)
"Export cancelled unexpectedly"
- Check internet connection
- Verify Salesforce API limits not exceeded
- Review error logs in status window
"Trigger deployment takes 15+ minutes"
- ✅ Expected behavior (runs ALL Apex tests)
- ✅ Deploy during maintenance windows
- ✅ Consider disabling in batches
"Some components failed to deploy"
- Check error messages in summary
- Components may have dependencies
- Retry individual components
Create a standalone macOS executable or .app bundle (no Python installation required on the target machine).
- The build must be created on macOS
- Python must be installed on the build machine
- Requires macOS 11+ for universal builds
python3 -m venv venvsource venv/bin/activatepip install --upgrade pippip install -r requirements.txtpip install pyinstallerRecommended (most portable): For Intel + Apple Silicon architecture (Universal Binary)
pyinstaller \
--onefile \
--windowed \
--name "SF_Meta_Exporter" \
--icon=app_icon.icns \
--target-arch universal2 \
--add-data "app_icon.icns:." \
main.pySingle architecture (either Apple Silicon or Intel):
pyinstaller \
--onefile \
--windowed \
--name "SF_Meta_Exporter" \
--icon=app_icon.icns \
--add-data "app_icon.icns:." \
main.pyCreate a portable .exe file for Windows deployment (no Python installation required).
pip install pyinstallerRecommended (most portable):
pyinstaller --onefile --windowed --name "SF Meta Exporter" --icon=app_icon.ico main.pyAlternative (faster startup):
pyinstaller --windowed --name "SF Meta Exporter" --icon=app_icon.ico main.py| Flag | Purpose |
|---|---|
--onefile |
Single .exe (more portable) |
--windowed |
Hide console window (GUI only) |
--name |
Custom executable name |
--icon |
Custom icon file (.ico) |
dist/
└── SF_Meta_Exporter.exe ← Your portable application
- Copy
.exefromdist/folder - Test on target machine
- No Python installation needed!
- Distribute as single file
File Size: ~50-80 MB (includes Python runtime + all dependencies)
Note: First run may be slow (extracts to temp directory). Subsequent runs are faster.
Contributions welcome! Please follow these guidelines:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
# Clone repository
git clone https://github.com/your-username/salesforce-metadata-exporter.git
cd salesforce-metadata-exporter
# Create virtual environment
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# Install dependencies with dev tools
pip install -r requirements.txt
pip install pytest black pylint
# Run tests
pytest tests/
# Format code
black .
# Lint code
pylint *.pyThis project is licensed under the MIT License - see the LICENSE file for details.
- CustomTkinter - Modern GUI framework
- Simple-Salesforce - Salesforce API wrapper
- Salesforce Developer Community - API documentation and support
For issues, questions, or feature requests:
- Check the Troubleshooting section
- Review status logs in the application
- Open an issue on GitHub
- Contact: your-email@example.com
Version: 2.0.0
Last Updated: December 2024
Author: Your Name
Made with ❤️ for the Salesforce community