Surprise… I am back on DualWrite troubleshooting again.
I got today’s error when I try to move the solution for DualWrite mappting solutions to a new power platform environment.
Solution "DualWrite Mapping Solution" failed to import: ImportAsHolding failed with exception :Cannot insert duplicate key exception when executing non-query: System.Data.SqlClient.SqlCommand Exception: System.Data.SqlClient.SqlException (0x80131904): **Cannot insert duplicate key row in object 'dbo.msdyn_dualwriteentitymapBase' with unique index 'ndx_for_entitykey_Alternate Key'**. **The duplicate key value is (0, eng_[accounts - Dynamics 365 Sales prospects], 1.0.1.3,** Jan 1 1900 12:00AM). The statement has been terminated.
DISCLAIMER: You should NEVER edit code in PRODUCTION and I know it is important with a proper ALM process (thanks Carina for telling me to clarify this). Also, in this setup there is no DualWrite connected DEV environment.
The issue in this case was that I am an idiot and I manually created a mapping customization in Production (you did what???? You always say that we should not do things in production!!!!) with the same version number as the one in UAT (are you kidding me???). When I then tried to import the solution from UAT to PROD I got the error (serves you right!!!) because it had the same name and version (Is that so #sarcasm).
The solution was to re-save the customization in UAT with a new version number, added it to the solution. I then re-exported the solution from UAT and moved it to PROD with no errors.
Thanks for today
/”The Idiot”
Leave a Reply