During development, I initially used the arbitrary name for the custom data entity. Later, during the review session, I updated the Label property of the data entity to align with proper naming conventions.
🔍 Best practice: Always use the label for the data entity display name, not hardcoded strings.
Since this was a small customization, I had directly written string values in some places, bypassing the label. However, when I triggered database synchronization, I encountered the following error:
❌ Error Message:
Error Log level - Error | Infolog diagnostic message:
'Cannot create a record in Entity (DMFEntity).
Entity: ProductCreationValidationEntityV2, DSTProductCreationValidationStaging.'
🧪 Root Cause:
Upon investigation, I found that the DMFEntity table contained multiple entries with conflicting labels for the same data entity names. This typically occurs when:
- You change the label or name of a data entity without cleaning up old records
- The model or metadata has inconsistencies after refactoring
✅ Solution:
You need to identify and delete the duplicate or orphaned records from the DMFEntity table.
🔍 Sample Queries:
Run the following queries in SQL Server Management Studio (SSMS) against your AXDB database:
-- View existing records for the custom entities
SELECT * FROM DMFENTITY WHERE ENTITYNAME = 'ProductCreationValidationEntityV2';
SELECT * FROM DMFENTITY WHERE ENTITYNAME = 'ProductCreationValidationEntityV2Lines';
SELECT * FROM DMFENTITY WHERE ENTITYNAME = 'DSTProductCreationValidationEntity';
-- Delete the orphan/conflicting records
DELETE FROM DMFENTITY WHERE ENTITYNAME = 'ProductCreationValidationEntityV2';
DELETE FROM DMFENTITY WHERE ENTITYNAME = 'ProductCreationValidationEntityV2Lines';
DELETE FROM DMFENTITY WHERE ENTITYNAME = 'DSTProductCreationValidationEntity';
⚠️ Warning: Always take a database backup before running any DELETE operation.
🧰 Next Steps:
- Perform a full build of your model
- Run database synchronization again
- Re-deploy the data entities, if required