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)

How to set Primary key to User field in Table

(0) ShareShare
ReportReport
Posted on by

Hello Buddies,

        In Dynamics Ax, I want to set Primary key for particular field in User defined Table, As far as SQL concern, we could easily set Primary key. But, I couldn't set Primary key to particular field in easy way.

 

I hope you tat understand my question...

Thanks

*This post is locked for comments

I have the same question (0)
  • Kiran Vaswani Profile Picture
    465 on at
    Re: How to set Primary key to User field in Table
    Hello,         Dynamics ax itself maintains a "RecId" field in every table for Id and also you can make a field primary.- In table node there is Indexes node- Just create a new index and Drag and drop you field there.- Set the AllowDuplicates property to "No"Thanks.  
  • Community Member Profile Picture
    on at
    Re: Re: How to set Primary key to User field in Table

    I want to set primary key for specific field in table rather using 'RecID'.. Also, Index is not given correct solution..

    Thanks for ur consideration

  • Kiran Vaswani Profile Picture
    465 on at
    Re: Re: Re: How to set Primary key to User field in Table

    Hello,

    Just check this out before rejecting index.

    http://msdn.microsoft.com/en-us/library/bb278358(AX.10).aspx

    After reading this if you think you can use index then please also set 2 more properties of your field.

    Mandetory = Yes and AllowEdit = No

    Thanks. 

     

  • Jason Reck Profile Picture
    50 on at
    Re: Re: Re: How to set Primary key to User field in Table

    Index is the correct solution for the table. You first will need to create an index with your respecitve fields that you want to be the primary index and set the index properties in the AOT to 'allow duplicates' = no. Once that is done, any indexes with that property set will show up in the PrimaryIndex drop down for the general table properties.

  • Community Member Profile Picture
    on at
    RE: How to set Primary key to User field in Table

    1) Create the Table and add required fields to the table as you all knows.

    2) Create an Index by dragging the required field to the Index.

    3) Set the following Index properties:

           a) AllowDuplicates to "no".

           b) Alternate key to "yes".

    4) Set the  Primary Index  property of the table to newly created index after creating the Index.

    5) For applying auto-increment you will have to use number sequence.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#1
Community Member Profile Picture

Community Member 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans