How to fill Line No or sequence No in order line with 1,2,3,4 automtically?

Hi, I am trying to fill order lines with products. It’s usually helpful to manage the Line No. automatically such as 1,2,3,4. Do I need use the Calculated attribution or Stored? how to make the arregation count value to work? When I create a new line, i just need count to be filled.
1 answers

If you want your orderlines to have an orderlinenumber, they will need to be the same every time you show the orderlines on screen. If upon rearranging or reloading the order of the orderlines changes and the linenumbers still go from 1 to 4, it is very confusing and the orderlinesnumbers are then even useless. Therefor you should create the linenumber upon committing. So certainly not calculated but stored.

The task of determining the number: retrieve all existing orderlines of the above order and generate the next number. Best do this as part of the BeforeCommit-microflow.