Let me provide a comprehensive solution that addresses all the key points we’ve discussed:
1. Data Management Framework Entity Configuration:
First, reconfigure your VendorV2Entity to properly handle alternate keys. Navigate to Data Management > Entities > VendorV2Entity and add TaxID as an alternate key in the entity properties. This is separate from the field mapping - you need both configured.
Entity settings:
- Primary key: VendorAccount
- Alternate keys: TaxRegistrationNumber (Tax ID field)
- Update mode: Update existing records
2. Deduplication Key Mapping for Vendor Master:
The critical issue is your Tax ID format mismatch. Implement a transformation in your source data extraction that normalizes Tax IDs before they reach D365. If you’re using SQL Server as your source, apply this transformation:
SELECT
VendorID,
REPLACE(REPLACE(TaxID, '-', ''), ' ', '') AS TaxRegistrationNumber,
VendorName,
...
FROM SourceVendors
This strips all dashes and spaces, ensuring exact matching with D365’s stored format.
3. Tax ID Validation and Normalization:
Add a pre-processing validation step in your DMF project. Create a custom staging table validation that:
- Normalizes incoming Tax IDs to remove formatting
- Queries VendTable to check for existing vendors with matching normalized Tax IDs
- Marks staging records with a validation status (NEW/UPDATE/DUPLICATE)
- Prevents import of records marked as DUPLICATE until manually reviewed
You can implement this as a staging table method or a separate validation query that runs before the import step.
4. Batch Import Staging Validation:
Review your batch job configuration and enable these critical settings:
- Enable “Validate on import” in the entity properties
- Set “Error handling” to “Stop on first error” during testing
- Add a post-import validation report that identifies any duplicate Tax IDs created
- Configure the batch job to run vendor imports sequentially, not in parallel
Additional Recommendations:
- Create a cleanup script to identify and merge existing duplicates before implementing the fix
- Set up a recurring batch job that scans for duplicate Tax IDs and alerts your team
- Document the Tax ID normalization rules in your data governance procedures
- Test the new configuration with a small subset of vendors in a non-production environment first
Root Cause Summary:
Your issue stems from three compounding factors: (1) alternate keys not properly configured at the entity level, (2) Tax ID format inconsistency between systems preventing successful matching, and (3) missing staging validation that would catch duplicates before import. Addressing all three is essential - fixing just one or two won’t fully resolve the problem.
The normalization transformation is your quickest win and should immediately reduce duplicate creation. The alternate key configuration ensures the DMF uses Tax ID for matching. The staging validation provides a safety net for edge cases.
Let me know if you need help with the specific validation query syntax or if you encounter any issues during implementation.