web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

"Natural key not found" when creating a custom data entity

(1) ShareShare
ReportReport
Posted on by 137

Hello Everyone,

while creating custom data entity by using header and lines scenario, i am getting the below error.

while creating custom data entity classes and target entities also not creating.

Kindly provide the solution to resolve this error and let me know is there any way to get classes and target table. 

6283.Capture.PNG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Create an index of TestLines tables that can be used as the natural key. You can't ask external systems or users to provide RecIds, therefore you need some user-oriented ID, name or so as an alternate key to the surrogate one.

    By the way, please let me change the title, because "Regarding Creation of Custom Entity in AX7" doesn't say much about the content of your thread.

  • Suggested answer
    krishna srikanth Profile Picture
    137 on at

    Thanks Martin for title change & suggestion and yes i have used natural key as an index & works well now.

  • AndreaAX Profile Picture
    on at

    Hi,

    I try to create an Entity for CustPackingSlipJour/CustPackingSlipTrans but I have the same error.  I have to create a index and use it with replacementKey of table? I use the extension approach.

    Can someone help me?

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You definitely need some natural key; record IDs aren't useful outside AX.

  • Mohamed-Amine HAMDAOUI Profile Picture
    72 on at

    Hi,

    OK, what if a table doesn't have a Natural Index : CustTrans, CustInvoiceJour, GeneralJournalAccountEntry... And we want to use the entity only for export. How can we achieve that?

    The main purpose for us to create these entities is to by pass the excel export limit 2000 (10000 update plateform 7) so we can export all records with no limit...

    Thanks for your help.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    There already is a standard entity for GeneralJournalAccountEntry called GeneralJournalAccountEntryEntiry. I assume they simply created it manually, without using the wizard.

  • Birdzhan Myumyun Profile Picture
    87 on at

    Hello,

    Is there a way to chose a column as a natural key instead of creating index column?

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    No, it's a property of index, not of table fields. You must realize that the key can consist of several fields.

    Note that the wizard uses this to create entity keys; if you build the entity manually, you can design the entity key by yourself without paying attention to properties. But you still need an index for performance reasons.

  • Birdzhan Myumyun Profile Picture
    87 on at

    I've tried this as a fix https://goo.gl/uZ9GMF

    But I am not allowed to overwrite the table so it didn't work.

    Can you tell me how to create an index?

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You didn't explain what you mean by "I am not allowed to overwrite the table", but note that indexes can also be added in table extensions. (Which doesn't necessarily mean that the wizard uses them; I didn't test that.)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans