Illegal data conversion from original field

Using Microsoft Dynamics (Axapta) 2012 R1.

So yesterday I added a field named “QuotationNumAcross” to the salesLine table.  Today, I show it to my manager and he say ‘Oh, we didn’t want it there, we want it on the sales quotation table.  So I deleted the field.  When I import it into live the import fails on the synchronization step with two errors like this:

Illegal data conversion from original field SalesLine.<field name> to SalesLine.<some other field>: unable to convert data types to anything but character field type (0 to 4)

I went to google and started looking around… and then Live suddenly crashed.  For everyone.  That was odd… I informed our IT guy and came back.  The service hadn’t restarted so I started it.  It lasted 5 minutes before crashing again.  At this point, I realized that I wasn’t going to be having a good day today.

The internet recommended that I rename my table, synchronize to get the original table, and then copy the data from the renamed table to the original.  I had to rename the indexes as well, but when it came time to copy the data I got sql this error:

Msg 257, Level 16, State 3, Line 1
Implicit conversion from data type datetime to numeric is not allowed. Use the CONVERT function to run this query.

I didn’t know how to fix that, nor did I want to spend the time to find out.  Live was down, and it was my fault, and I needed it back up ASAP.  Instead, I deleted the ‘QuotationNumAcross’ field directly from the table, and renamed it back to its original name.  Then in Axapta I confirmed I could synchronize and everything was fine.

Except not quite.  I soon get calls saying that the sales confirmation report is displaying the fields wrong – the packing spec was showing up where the UPC is supposed to be, and so forth.  Restarting the reporting service didn’t fix it, but it did get fixed when I resaved and recompiled the SalesConfirmDP class.  A little later I get a call that they can’t create sales orders, and I fixed that one by recompiling SalesLineType.  I wouldn’t be surprised if I get more errors, the day is still young.

So, this is how you solve that problem the hard way.  The solution was complicated because it occurred in live, and I didn’t have time to conduct a thorough investigation.  If anyone know what I should have done instead, leave a reply below.

Leave a comment