Blog

Microsoft Dynamics AX Thoughts

9

This topic might not be new to most of you guys, but I always wondered how can I create a primary key to a Dynamics AX table?

You could easily create index in any table in Dynamics AX and you could specify that this index is “not duplicated”, which means that values of the field(s) should be unique among the table values. But this does not mean that you this index is a Primary Key index!

To create a Primary key you have to set the PrimaryIndex property in the list of that table properties.

PrimaryIndex Property

When you choose the PrimaryIndex property you have to set that index as “not duplicated”. Once you do that, you will have the icon of that index changed to be like this:

Primary Key Index Icon

9 Comments to “How to Create a Primary Key for a Dynamics AX Table”

  • Wow, this was enlightning! ;-)

    To be honest, the compiler warns the developers when the table does not contain a primary index so this is something quite basic.

    Tip : You can also specify this index as the clustered index on the table so that the data on SQL is physically ordered according to this index.

  • Hi Kenny!

    Many thanks for your post. This is quite right. :)

    • hai,
      thanks for ur poat can u send me some basic information for AIF implementation and usages..
      to my mail id esriaditya@gmail.com

  • This describes how to make a ‘Primary Index’ and not a ‘Primary Key’.
    How do you make a ‘Primary Key’ from the AOT?
    The method above will not generate a ‘Primary Key’ (KEY, not INDEX).

    • This will do the job Brian – if you change a table in this manner the selected index will be propagated to SQL as the primary key.

      • Thank you Chris!

      • how i will make one particular field as a primary key…
        as i i’m assigning the primary index in the table property. how the table will understand which field has primary key.

  • Thanks alot Mr. Amer.

  • Good but we have set primary key when there an index option for not allowing duplicates

Post comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Ziad Yehia, ERP Business Consultant at NetWays

    no_thumb"I have one thing to say about Amer, When you have a tough Dynamics AX question that you are not able to answer; he is the person to call..."

  • Read more testimonials »

Posting tweet...

Powered by Twitter Tools