Secondary unique indices

Hi, How can I define in a Table a secondary unique index ? I have shown that in design time there is no way. Instead of programming for this is there a more efficient way ? Thanks in advance

Sure you can add a key in design time. Just open the table in design, click View/Keys and voila, you can enter your secondary keys.

I think Philip knows that but he would like to make sure that records are also unique according to a secondary key. It has to be done through C/AL, there is no UNIQUE constraint… [:)]

oh no that’s not possible, you’ll have to program that, sorry :frowning:

Hi, but it isn’t a big task to do the coding in the OnInsert-trigger of the table. I think that the searching for all inserts to the table and replacing with Insert(true) is more difficult.