D365 FO/AX7: The natural key for the table XXXX was not found [Solved] Data Entity Error

  • Issue – During the creation of data entity of table VendInvoiceTrans in Microsoft Dynamics 365 Finance and operation, system is throwing error- The natural key for the table VendInvoiceTrans was not found.
  • Root Cause The reason is that the table VendInvoiceTrans is using  RecId as its primary index. D365 Fo Data Entity Wizard doesn’t support tables with a RecId as a primary index.
  • Steps to Solve
  • Duplicate any existing data entity in your D365 fins and ops project and model. In my case i am making a duplicate copy of existing data entity – EMPSurveyTableEntity
  • Rename the duplicate copy of data entity
  • Change the existing datasource of data entity from EMPSurveyTable to VendInvoiceTrans
  • Delete existing fields of data entity and add new field from datasource vendInvoiceTrans
  • Remove the field from KEYS –> ENTITY KEY and new fields as per your need from datasource VendInvoiceTrans. ENTITY KEY fields should not allow duplicate and should be unique combination.
  • Change the Data entity properties PUBLIC COLLECTION NAME , PUBLIC ENTITY NAME & DATA MANAGEMENT STAGING TABLE to new values.
  • Right click on data entity and regenerate Staging Table Again
  • Assign data entity to security privilege.
  • Rebuild and synchronize the project .

One thought on “D365 FO/AX7: The natural key for the table XXXX was not found [Solved] Data Entity Error”

Leave a Reply