```const rate = order.getSublistValue({sublistId: ...
# suitescript
c
Copy code
const rate = order.getSublistValue({sublistId: 'item', fieldId: 'rate', line: orderLineid});
This code works for all items on a SalesOrder except the last line. The last line is line:13 and orderLineId = 13. The value that comes from getSublistValue (for the last line) is undefined. Any ideas why this might be happening??
e
in 2.0 suitescript version, the first index line = 0, the index for the last line should be 12.
b
line id is not the same as line (sequence) number
c
I'm doing this first to get the orderLineid variable
Copy code
const fulfilmentLine = fulfilment.findSublistLineWithValue({
    sublistId: 'item',
    fieldId: 'line',
    value: orderLineid
});
So that should give me the correct array index number
the orderLineid variable is just the line field on the SO item sublist
b
same answer, line id is not the same as the line number
its most obvious when you start doing things like inserting line at the beginning of the item sublist instead of at the end
c
I've probably just gotten myself confused while walking through the code. I'm aware of the array index starting at 0 and the line ID being sequential starting at 1 (or however it sets it). I'll take another look to see where it's mixed up. Thanks.