I see that error very often when people try to loop forward through the lines and remove some or all of them; you inevitably go past the sublist length
c
Craig
11/05/2020, 4:39 AM
Slight tangent. I assume the line id is always maintained though?
e
erictgrubaugh
11/05/2020, 4:44 AM
You remove lines using their index, and as you remove lines, all the indices collapse immediately to remain contiguous. Not sure which
line id
you mean in this context.
c
Craig
11/05/2020, 5:00 AM
the item sublist
Craig
11/05/2020, 5:00 AM
the line field
Craig
11/05/2020, 5:03 AM
I believe this field is always maintained - I can see orders with 4 items in the item list with one item having a 'line' 8
Craig
11/05/2020, 5:06 AM
the index is a 'point in time' in your code, the .length of a list will need recalculating every time you remove or add an item (depends exactly what you're doing).