Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Map becomes Table

Posted on by Microsoft Employee

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!

  • Suggested answer
    Logger Profile Picture
    Logger 60 on at
    Map becomes Table
    The solution to prevent such corruption :
     
    Some additional simple fix to correct corrupted map/view :
    This scripts accounts for layer of table.
  • Martin Winkler Profile Picture
    Martin Winkler 119 on at
    RE: Map becomes Table

    Thanks Thomas, the second solution worked for me as well. In my case, view TAXTRANSTRANSACTIONLINELEDGERDIMENSION was affected, and I have no idea why it happened.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX2012 Map becomes Table

    Hi Thomas,

    thank you!

    The SQL patch helped me.

  • Florian Hopfner Profile Picture
    Florian Hopfner 2,440 on at
    RE: AX2012 Map becomes Table

    Today I had a special case of this problem that may be helpful in narrowing down the cause. This time it was map LogMap, which is used as a map for table SysDataBaseLog (among others). The table and its map is used in the Application class, so if the map does not exist anymore, this class has several compile errors that occur very fast because the Application class and the affected methods are used quite a lot, for example during client startup.

    So this morning I started the client no problem so I assume the map was still a map. Then I did some regular development (added a display method to a table, duplicated and modified an infopart and its menu item, changed a form). Then I wrote a unit test for the display method and when executing the unit test, the compile error in class Application was reported.

    I'm not sure if the problem was caused by something I did during development (a reproduction of the development steps on another system did not cause the problem) or by something unrelated, but at least this tells me that the problem is not just caused by hotfix installations.

  • Florian Hopfner Profile Picture
    Florian Hopfner 2,440 on at
    RE: AX2012 Map becomes Table

    For one of my projects, this problem still appears about every other month or so. Does anyone have any new information on this, especially on what causes the problem?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX2012 Map becomes Table

    Thanks a lot. I'm trying to fix the error.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX2012 Map becomes Table

    Hello Macro,

    Yes, b. is to delete the .auc files in your C:\Users\(username)\AppData\Local folder.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX2012 Map becomes Table

    Hi everybody .... for the point "b.      Stop AOS and delete client side cache files" do you mean to delete the file auc?

  • Florian Hopfner Profile Picture
    Florian Hopfner 2,440 on at
    RE: AX2012 Map becomes Table

    I had a similar problem with view SubLedgerJournalEntryNotTransferred  which was shown as a table. Solution 2 (Direct SQL patch) worked. Still, I wonder how these errors are caused. If it is stale client caches, how are they caused?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX2012 Map becomes Table

    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.

    2.       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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans