<https://gyazo.com/f6559c5f964af237ed080356f24a1c9...
# suitescript
j
https://gyazo.com/f6559c5f964af237ed080356f24a1c97 Is there a way to get that specific value without looping through every item in the sublist?
e
the totalling field can be set via “Sublist.updateTotallingFieldId(options)” but not sure how to read other than possibly some DOM scripting
j
My current work around is looping through the expense items (which are less lines) and subtracting the expense total from the overall total.
e
is it that much quicker? can’t imagine you lose so much time simply looping through the items themselves (instead of expenses). . . Of course, not looping at all would be ideal. not sure
j
Well in the case of there not being expenses, it will be a lot quicker because total - 0 = total Also if a PO has a lot of lines, looping through 1-3 lines is a lot quicker than looping through 50-100
😆 1
j
@Jared Fraley I'm not sure, but what if there are other sublists in the record that also contributes to the total? Won't that break your logic?
j
@Joe Thomson I am working with the Purchase Order record, and there are only 2 sublists that contribute to the Total (Items and Expense)
j
@Jared Fraley 😄👍 I've seen multiple sublists in an invoice (see screenshot).
j
@Joe Thomson This is for a PO Re-Approval workflow, I just needed to distinguish only changes where item total amount went up, this is the best solution I have haha
🙌 1