Data dictionary object is displayed as another type

Meaning you have a table, but something happens (installing a HF, doing an external compilation, etc) and suddenly it is listed as a view, or a map. Or, you have a map and it is showing now as a table. Or any other combination like this. Just got to experience this today on one of my instances.

I got it solved, now, I don't know if all of you agree with going this path, but, as long as you know what you are doing it should be fine.

Basically, I went straight to the model database, and changed the Properties column's value in the ModelElementData table for that particular object with the value I retrieved from a good AX instance (this could be one problem: you must have a second good AX instance, from where to copy that value).

The T-Sql I ran go like this:

use MicrosoftDynamicsAx_model
go

select * from ModelElement me
join ModelElementData med on me.ElementHandle = med.ElementHandle
    where Name = 'AX Corrupted Object Name'

go

 this will give you the information from the model database. Run this on the corrupted instance, as well as on a good one. Basically, your Properties column should be different.

If they are then just do a:

update ModelElementData
set Properties = 0xyourvaluehere
    where ElementHandle = Element'sHandleFromAbove  

Of course, in my case it was only one record that was being returned by the first select (this means I had that objects only in one layer (and of course model), so I did not worry about different properties at different layers' levels). However, if you have more than one record, I believe you have to pay extra attention to what you are updating (but this can still work).

2 comments:

  1. You can also find further information about this problem at http://blogs.msdn.com/b/axsupport/archive/2014/05/23/ax-2012-a-tablemap-object-turns-to-be-a-table.aspx
    I have yet to find information about what exactly causes this problem.

    ReplyDelete
    Replies
    1. Hi Florian,

      Thanks for pointing that out, the T-SQLs are indeed more elaborated, and you can choose from either options now :)
      As for the cause, I believe it is unknown and will stay the same for some time (at least in the current implementations), so if this happens, just be prepared and know how to fix it, right?

      Delete