AX2012 Map becomes Table

Hi,

I’m having an issue after installing hotfix 2816385. The hotfix is a kernel update, it doesn’t affect any AOT object. However, when trying to compile we now receive an error in object VendPaymSched. There’s a method in there which tries to access a map that no longer exists. This map is “CustVendPaymentSched”. The map is present in another still working AX environment (where we didn’t yet installed the hotfix).

After further investigating we noticed that the object CustVendPaymentSched is now present as a table in the non-compiling environment. So somehow, the hotfix, or something else, has changed the CustVendPaymentSched map into a CustVendPaymentSched table. The table has all the same properties as the map in the good environment (Label, ConfigrationKey, LegacyId,…). These objects are all on the sys layer so I can’t remove it.

I have already logged this issue with Microsoft but as this is very blocking I decided to give it a shot here. Does anyone have a clue how this could have happened and how I can fix this?

Thanks in advance!

Apparently the hotfix installation combined with client cache files caused the error. Microsoft was able to provide me the following solution:

It may be related to the presence of stale client cache files when the customer compiled their application. The workaround is to delete the customer model, delete the client cache files, re-import and compile.

So here are 2 options for you to correct behavior. The first one is preferred but would take longer time. Both require to setup a clean environment with MS models only (here it’s called BaselineModelStore). Please make sure that there is a healthy Model DB in same SQL instance in order to copy from and overwrite the corrupted object properties in affected DB. Remember to correct DB and objects name references in SQL script accordingly.

Please not this is just a workaround. “Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This mail message assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures.

  1. Model store import

a. Export any non-MS models to model files

b. Export model store file from BaseLineModelStore

c. Stop AOS and delete client side cache files

d. Import model store file from c.

e. Import model files from a.

  1. Direct SQL patch

a. Find offending element (i.e. xxxxMap)

b. Stop AOS and delete client side cache files

c. Run attached SQL query to update the metadata (replace corrupted metadata from good one on BaselineModelStore)

Here is the SQL script:

– Assumption: Script works against dev model store

– Assumption: Clean baseline model store is named: axdbdev_model_id_baseline (can be replaced by own naming)

– Check existence affect object in dev environment

use MicrosoftDynamicsAX

SELECT m.ElementType, m.Name, m.AxId, md.LayerId, manifest.DisplayName, md.Properties as Metadata

FROM [dbo].ModelElement AS m

INNER JOIN [dbo].ModelElementData AS md

ON m.ElementHandle = md.ElementHandle

INNER JOIN [dbo].ModelManifest AS manifest

ON md.ModelId = manifest.ModelId

AND m.ElementType = 44 AND m.Name = ‘DirPartyLookupGridView’

– Check existence affect object in baseline environment

use MicrosoftDynamicsAXBaseline

SELECT m.ElementType, m.Name, m.AxId, md.LayerId, manifest.DisplayName, md.Properties as Metadata

FROM MicrosoftDynamicsAXBaseline.[dbo].ModelElement AS m

INNER JOIN MicrosoftDynamicsAXBaseline.[dbo].ModelElementData AS md

ON m.ElementHandle = md.ElementHandle

INNER JOIN MicrosoftDynamicsAXBaseline.[dbo].ModelManifest AS manifest

ON md.ModelId = manifest.ModelId

AND m.ElementType = 44 AND m.Name = ‘DirPartyLookupGridView’

– Replace corrupted metadata on dev environment from baseline environment

use MicrosoftDynamicsAX

Update md Set md.Properties = md_base.Properties

FROM [dbo].ModelElement AS m

INNER JOIN [dbo].ModelElementData AS md

ON m.ElementHandle = md.ElementHandle

INNER JOIN MicrosoftDynamicsAXBaseline.[dbo].ModelElement AS m_base

ON m.ElementType = m_base.ElementType AND m.Name = m_base.Name

INNER JOIN MicrosoftDynamicsAXBaseline.[dbo].ModelElementData AS md_base

ON m_base.ElementHandle = md_base.ElementHandle

AND m_base.ElementType = 44 AND m_base.Name = ‘DirPartyLookupGridView’ AND md_base.LayerId = 0

1 Like

Interesting… Thank you for posting the solution here!