sorting and counting

hello to all,

I am new in Navision and I get stuck with one exercise. I need to modify product group table, insert new fields “parent group” and level. Then make them to count and sort like this.

Code | Parent group | Level

AAA | | 0

BBB | AAA | 1

CCC | BBB | 1

but if we insert new line

Code | Parent group | Level

ZZZ | | 0

AAA | ZZZ | 1

BBB | AAA | 2

CCC | BBB | 2

I made setcurrentkey for “parent group” but what i need to do further? Any suggestions ? I will be very grateful for any help :slight_smile:

Welcome To DUG!!!

If I understand correctly you want to maintain levels in Product Group table.

You can check G/L Account Table and check how Navision creating Indentation

Yes, you understand correct, I need to make levels.

You can check the Chart of Account or Dimensions form . You will get an Idea.

Thank you. I found how to create indentation, but how to count that level? As in the mine example?