Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Composite Primary Key on Table

Posted on by 46,610 User Group Leader

hi everyone, is there some way to create and assign Composite Primary key for a table in Dynamics AX 2012?? If yes how?

As i have a table (my own customized), it have 2 fields both are of string type. so i want to use these fields as composite primary key. how this could be done as ax 2012 is restricting to this

*This post is locked for comments

  • Suggested answer
    Joris dG Profile Picture
    Joris dG 17,775 on at
    Re: Composite Primary Key on Table

    I agree with Martin, try to keep RecId are your PK and make your composite key the replacement key. If you really need the composite key as the primary, you have to set the "allow duplicates" to "no" and the "alternatekey" to "yes" on the index. If you then save the table, then the index will be available for selection in the primaryindex property.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    Re: Composite Primary Key on Table

    If you want to follow "AX2012 way of doing", you should use SurrogateKey as PK and your composite key as a replacement key.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans