Upgrade Issues (Part 3)

RefRecId fields without Extended Datatype

The upgrade scripts to AX 2009 converts RefRecId fields to Int64 data types. In some cases when a <Something>RefRecId field on a table has not an extended data type but was created as integer field you get a synchronization error.

Illegal data conversion from original field TABLE.FIELDREFRECID to TABLE.FieldRefRecId: Unable to convert string data types to anything but INT, or REAL field types.

The error message doesn’t really fit to the problem Trauriges Smiley

One way to deal with this issue is to copy the table content to another database. Next delete the malicious field and create a new one with RefRecId as extended datatype. AX will synchronized and delete the field on the database. Finally restore the data from the other database.importexportdb

I recommend to use the SQL Server Data Import/Export wizard.

  1. Create a new database called Backup
  2. Start SQL Server Import / Export from Programs Menu
  3. Source DB is the Upgrade DB
  4. Target DB is Backup (don’t use flat files etc.)
  5. Copy at least on table or view, select the malicious table and run
  6. In AX create a new field named as the defect one but as Int64 with RefRecId data type, e.g. MyRefRecId2
  7. In AX delete the original field and synchronize
  8. Start SQL Server Import/Export from Programs Menu and copy saved data back to Upgrade DB
  9. At selected table or view, activate overwrite instead of append

About erpcoder
Software Engineer and Dynamics AX enthusiast working in Research & Development for InsideAx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: