๐ Project Overview
CVN.XrmToolBox.RecordCompare2 is an XrmToolBox plugin designed to compare records between two Dynamics 365/Dataverse environments. It provides detailed insights into differences between source and target organizations, helping identify mismatches, duplications, and missing records.
โญ Features
Core Capabilities
Record Count Comparison
Quickly identify if source and target have matching record counts
Field-Level Comparison
Compare individual field values across matched records
Bidirectional Analysis
Compare sourceโtarget and targetโsource to catch all discrepancies
Note/Attachment Comparison
Validate notes and attachments are identical
Smart Filtering
Filter by website, creation date, custom expressions, and linked parents
Report Generation
Save comparison results with detailed mismatch files
Supported Models
- Standard Model: Uses direct link entities for parent filtering
- Enhanced Model: Uses in-memory joins for virtual table support
๐ง Installation & Setup
Prerequisites
- XrmToolBox (latest version)
- Access to source and target Dynamics 365/Dataverse environments
- Administrative permissions in both environments
Installation Steps
- Download the plugin DLL:
CVN.XRMTOOLBOX.RECORDCOMPARE.dll - Place in XrmToolBox plugins folder:
%APPDATA%\Roaming\MscrmTools\XrmToolBox\Plugins - Restart XrmToolBox
- Plugin will appear in the Tools menu
Initial Configuration
- Open the plugin in XrmToolBox
- Configure in Settings:
- Result Folder: Where comparison reports are saved
- XML Configuration: Select or create entity comparison config
- Extension Prefix: Custom prefix for extended fields (e.g., "adx" for Portal)
- Enhanced Model: Enable for virtual tables
- Compare Tool Directory: Path to diff/merge tool
- Dev Env Directory: Path to Visual Studio (optional)
โ๏ธ Configuration Guide
XML Configuration Structure
The configuration file defines which entities to compare and how:
Configuration Elements
| Element | Description |
|---|---|
EntityName |
Logical name of the entity to compare |
Name |
Display name for UI |
NotLinkedToSite |
If false, filters by website ID |
ParentLinkedToSite |
If true, parent records must be in same site |
IntersectEntity |
Set true for intersection/junction entities |
CompareNotes |
If true, compares notes/attachments |
Keys |
Fields used to match records between environments |
LinkedEntityKey |
Foreign key field in linked entity |
LinkedEntityName |
Name of the linked entity |
LinkedFieldName |
Field to retrieve from linked entity |
Excluded Fields Configuration
Define fields to skip during comparison (e.g., system fields, timestamps):
๐ Usage Guide
-
Select Target Organization
- Click "Select Target" button
- Choose your target environment connection
- Verify connection details
-
Select Entities to Compare
- Check the entities you want to compare from the entity list
- Use "Select All" to compare all configured entities
-
Configure Filters (Optional)
- Website/Site: Select from dropdown
- Created On: Check box and select date to filter by creation date
- Custom filters via XML configuration
-
Run Comparison
- Click "Run" or "Process" button
- Monitor progress in the status bar
- Wait for comparison to complete
-
Review Results
- Results appear in the grid showing Type, Entity, Key, Field, V1/V2 values, and Direction
- Large field values are saved to files for comparison
- Use integrated diff tool to visualize changes
๐ Data Models
CompareResult
ResultLog
Result Types
CountMismatch- Different record countsNotFound- Record exists in source but not targetDuplication- Multiple matching records in targetMismatch- Field value differsNotesCount- Different number of notesEmptyKey- Key field is nullFilesizeMismatch- Note attachment size differsNoDifference- No differences found
๐ฏ Advanced Features
Linked Entity Matching
Match records by related entity fields (e.g., match by Form Name instead of ID):
Parent Record Filtering
Filter child records by parent's website:
File Comparison
Large field values (>40 characters) are automatically saved to files:
- JSON files: Auto-formatted for readability
- HTML files: Detected and formatted
- XML files: Detected and preserved
- Text files: Plain text comparison
๐ Troubleshooting
Issue: "No results found" or empty comparison
- Verify website selection is correct
- Check if date filter is excluding records
- Ensure entities are configured in XML
- Verify entity permissions in both environments
Issue: Service connection fails
- Test connection with basic retrieve query
- Check network connectivity
- Verify authentication credentials
- Review debug output window
Issue: Virtual table comparison shows different counts
- Enable "Enhanced Model" in settings
- Ensure
ParentLinkedToSiteis configured correctly - Check parent records exist in target environment
Issue: Notes comparison fails
- Verify
CompareNotesis enabled in config - Check annotation records have filenames
- Ensure file paths are accessible
๐ Output & Reports
Result Files
Comparison results are saved to the configured Result Folder:
- Large field values saved with format-specific extensions (.json, .xml, .html, etc.)
- File naming:
{RecordId}_{Step}_{Service}.{ext} - Example:
550e8400_1_1.json
Viewing Results
- In-Application: Browse grid in plugin
- File System: Open Result Folder
- Diff Tool: Right-click โ Open with configured comparison tool
โก Performance Considerations
Large Datasets
- Tool loads results in-memory for filtering
- Recommended limit: 5,000 records per entity
- For larger sets: Use date filters or custom filters
Optimization Tips
- Filter by creation date to reduce scope
- Use specific keys for matching (avoid generic fields)
- Exclude unnecessary fields
- Disable note comparison if not needed
- Run during off-peak hours