I have several form which will show a list with a sequential order number like 1,2,3,4, etc. (See picture below). I want this field LineOrder to be autogenerated with the next unused value when a new record is created, so if the last one used is 5, then when clicking New, the value will be 6.
I added the following code in the PaymentMethodBO.vb:
nextLineOrder =
nextLineOrder = 1
So far this is working fine, but I would like to make sure this is the proper way to get this done when working with data in the BO. I guess I may have another BO with a SELECT MAX() statement to get the last value used and then increment this value. So I would appreciate any recommendation in this regard.
Thanks!