A CLI tool to identify and report dangling field permissions in Salesforce profiles and permission sets
npm install dangling-fields
A powerful CLI tool to identify and report dangling field permissions in Salesforce profiles and permission sets. Quickly find dangling field references that don't exist in your local project or Salesforce org.
- š Comprehensive Scanning - Analyzes profiles and permission sets for dangling field permissions
- š Org Validation - Checks both local metadata and live Salesforce org
- š Beautiful Reports - Generates interactive HTML reports with DataTables
- š„ CSV Export - Export findings to CSV for further analysis
- šÆ Selective Scanning - Process specific files or entire directories
- ā” Rate Limiting - Configurable pause between API calls to respect org limits
- šØ Dark Theme UI - Modern, eye-friendly interface
``bash`
npm install -g dangling-fields
bash
npx dangling-fields --help
`
š Usage
$3
$3
`bash
dangling-fields -o myorg@example.com -f "Admin.profile,CustomPermSet.permissionset" -s /path/to/sfdx/project
`$3
`bash
dangling-fields -o myorg@example.com -f "Admin.profile,CustomPermSet.permissionset" -s /path/to/sfdx/project -p 2000
`š ļø Command Line Options
| Option | Alias | Description | Default |
|--------|-------|-------------|---------|
|
--sfdxProjectFolder | -s | Path to SFDX project folder | Current directory |
| --orgUsername | -o | Salesforce org username (required) | - |
| --what | -w | What to check | fieldPermissions |
| --pause | -p | Pause duration (ms) after each file | 1000 |
| --files | -f | Comma-separated list of files to check | All files |š Prerequisites
- Node.js 14.x or higher
- Salesforce CLI (
sf command) installed and authenticated
- A Salesforce DX project with metadata in standard formatš§ How It Works
1. Connects to Org - Uses Salesforce CLI to authenticate and retrieve org information
2. Scans Metadata - Reads profile and permission set XML files from your project
3. Validates Fields - Checks each field permission against:
- Local field metadata files
- Live Salesforce org field definitions
4. Generates Report - Creates an interactive HTML report with all findings
5. Exports Data - Allows CSV export for further analysis
š Report Features
The generated HTML report includes:
- ā
Searchable Table - Quickly find specific objects or fields
- š¢ Pagination - Navigate large datasets easily
- š Sortable Columns - Sort by any column
- š„ CSV Export - Download findings for spreadsheet analysis
- šØ Visual Indicators - Clear checkmarks (ā
) and crosses (ā)
- š± Responsive Design - Works on all screen sizes
šÆ Use Cases
$3
Identify and remove field permissions for deleted or non-existent fields before deployment.
$3
Verify profiles before deploying to production to avoid deployment errors.`bash
dangling-fields -s ./deploymentPackage -o production@company.com
`$3
Check only specific profiles or permission sets.`bash
dangling-fields -o myorg@example.com -f "Admin.profile,SalesUser.profile"
`$3
Integrate into your CI/CD pipeline to catch issues early.`bash
npx dangling-fields -o $SF_USERNAME
`š Example Output
$3
`
š Initializing...
Connected to org: myorg@example.comš§ Processing all files...
ā”ļø Processing: Admin.profile-meta.xml
š Account.CustomField__c not found locally, checking org myorg@example.com...
ā Missing: Account.CustomField__c
ā
Found in org: Contact.Email
Continue? (y/n): y
ā
Completed scan. Found 3 missing fields.
HTML report generated at: /path/to/missing_fields_report.html
``This project is licensed under the MIT License (c) Mohan Chinnappan