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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Primary Key Must Be Mandatory

(0) ShareShare
ReportReport
Posted on by 485

We have an AX2012R3CU10 system that just started throwing a best practice error on one table that the primary key field "fieldName" must be mandatory.

- No updates applied to AX

- No changes made to this table in literally years

- The field is set to Mandatory = Yes

- Tried deleting and reimporting

- Tried synchronizing

- Tried a full AOT compile

- Tried deleting the indexes

Completely out of ideas.

Anyone else run into this?

Thanks,

- Brad

*This post is locked for comments

I have the same question (0)
  • Brad Docimo Profile Picture
    485 on at
    RE: Primary Key Must Be Mandatory

    I finally just gave up and deleted the table.  Recreated the exact same thing with a new name, and the errors are gone.  AX can be very frustrating..

  • Fredrik Sætre Profile Picture
    12,644 on at
    RE: Primary Key Must Be Mandatory

    Make sure your indexes are set correctly and check the article I referred to to check that all is set correctly on the table settings.

  • Brad Docimo Profile Picture
    485 on at
    RE: Primary Key Must Be Mandatory

    Chaitanya, I deleted the table, synchronized, verified it is completely gone from the SQL database, reimported the table.  It remains empty, but the errors return.

  • Brad Docimo Profile Picture
    485 on at
    RE: Primary Key Must Be Mandatory

    Fredrik, thanks for responding.  This is a custom table.

  • Chaitanya Golla Profile Picture
    17,225 on at
    RE: Primary Key Must Be Mandatory

    Hi,

    I think best practice error might have occurred as the field may not be marked/recognized as not null on the backend.

    Please try the following steps(as you mentioned you tried deleting & reimporting)

    - Take backup of the table

    - Delete the table from backend(i.e from Sql Server Management Studio)

    - Synchronize the table from AX to create a new copy of table in the backend.

    - Import the data back

    Hope this helps you.

    Thanks,

    Chaitanya Golla

  • Fredrik Sætre Profile Picture
    12,644 on at
    RE: Primary Key Must Be Mandatory

    What table are we talking about? Also please check out this post that might solve the problem.

    ax2012exceldataimport.blogspot.in/.../dynamics-ax-2012-data-import-using_17.html

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
howalker Profile Picture

howalker 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans