Regenerating/ updating a staging table in Dynamics 365 has literally been made as easy as a one click operation but somehow not well documented so I though i’d write a quick overview on how to update or regenerate a staging table based on your Data entity changes.
Open your data entity in visual studio and right click on the entity name like below this will show you the two options. Please note that if you regenerate a table all custom changes you made to that table will be lost. However if you use the update table option, only new changes will be added. For example if you add a field only on staging table and regenerate staging table the custom field will be lost, therefore if you would like to maintain your additions and update, use update staging table option.
After creating a data entity you might receive the following 15 errors upon building it, these recommend you to do a full build of your package but this will not resolve the issue. The cause of this error is an existing entity record in your DMFEntity table and like some solutions have mentioned that you delete those records and rebuild they will work for only once but when you make changes and run a build again you will get a the same errors, so lets come to what is causing this. It is clear that there is a duplicate but when I verified that there is none according to my Entity name and table names within the DMFEntity table that could cause a duplicate, what could it be? Well to your and my surprise the label you have on your entity is also a factor when it comes to duplication. And since D365 has existing data entities for a number tables out of the box it is quite possible that your new entity that you built got the default table label.
Error Database synchronization failed. You may have to do a full build of the package ‘TrueValue_Retail’ and all of its dependent packages. 0
Error at Dynamics.AX.Application.DmfDataPopulation.`syncEntityMetadata(StringCollection dataEntityViewCollection, StringCollection compositeEntityList) in xppSource://Source/ApplicationFoundation\AxClass_DmfDataPopulation.xpp:line 817.’ on category ‘Error’. 0
Error Infolog diagnostic message: ‘Error synching entity metadata for entity – TVRetailExportLoyaltyCustomer. Message – at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue, interpret* ip) 0
Error Infolog diagnostic message: ‘Cannot create a record in Entity (DMFEntity). Entity: Loyalty card, TVRetailExportLoyaltyCustomerStaging. 0
Give your entity a custom label.