Skip to main content What is Dynamics 365? Guided tours Customer stories Try our products Build your own agents CRM ERP Sales Service Sales Customer Insights Customer Service Contact Center Field Service Supply Chain Management Commerce Finance Project Operations Human Resources Business Central Pricing Business application topics Training & certifications Documentation Migrate to the cloud Private equity Migrate to Dynamics 365 Events Dynamics 365 Blog Product updates Onboarding and implementation Community Find a partner Software Development Companies Partner resources Microsoft Marketplace Product documentation Technical support On-premises product support Contact us Try for free Sign in

 

Issue description:

 

We have seen some scenarios while deploying Models/ModelStore among multi environments, 

that a TableMap object turns to be a Table.

Cause:

Unknown, no consistent repro pattern has been spotted

Resolution suggestion:

We take e.g. that the affected object is the ‘CustVendInvoiceTrans’ table map.

Run the following SQL script in order to correct the object type:

— 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 

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 = ‘CustVendInvoiceTrans’

 

— Check existence affect object in baseline environment

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

FROM axdbdev_model_id_baseline.[dbo].ModelElement AS m

INNER JOIN axdbdev_model_id_baseline.[dbo].ModelElementData AS md

ON m.ElementHandle = md.ElementHandle

INNER JOIN axdbdev_model_id_baseline.[dbo].ModelManifest AS manifest

ON md.ModelId = manifest.ModelId

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

 

— Replace corrupted metadata on dev environment from baseline environment 

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 axdbdev_model_id_baseline.[dbo].ModelElement AS m_base

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

INNER JOIN axdbdev_model_id_baseline.[dbo].ModelElementData AS md_base

ON m_base.ElementHandle = md_base.ElementHandle

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

Get started with Dynamics 365

Drive more efficiency, reduce costs, and create a hyperconnected business that links people, data, and processes across your organization—enabling every team to quickly adapt and innovate.