Problem with primary index

hi all,

i have two fields in my table. i want to set those fields(field1+field2) as my primary index… how to set these combination as my primary index???

Its simple.

  1. Create an index (let say ‘ABC_Idx’) under Indexes node for the table.
  2. Add two fields in the index.
  3. Set “Allow Duplicate” to No.
  4. In Table Property Set Primary Index as ‘ABC_Idx’.

hi Shreyash Shukla ,

the created index is not getting displayed in the drop down of the primary index property…

There is a property ‘Included Column’ for field node of Index. If Index contain multiple column then it does not appear in Primary Index in table properties. So the solution is to set Included Column to ‘Yes’ for all the fields but one. And then only u can use this index as primary index.

Also check

What’s your version of AX? It looks like it’s AX 2012. In that case, don’t use composite primary keys - define your key as a replacement key and leave the surrogate key as the primary one.

But Setting “IncludedComum” to yes will make primary index to work but data uniqueness will be hampered. So use indexes cautiously :slight_smile: