yeah, i'd like to prove this is always true, but t...
# suitescript
d
yeah, i'd like to prove this is always true, but the NS docs don't help, it might be a matter of reaching out and asking somebody there, but what I've found so far:
Copy code
var rec = nlapiLoadRecord(nlapiGetRecordType(), nlapiGetRecordId());

for(var i = 1; i <= rec.getLineItemCount('item'); i++){ // print each item fulfillment line's: orderdoc, and orderline
  console.log(rec.getLineItemValue('item', 'orderdoc', i), rec.getLineItemValue('item', 'orderline', i));
}
// prints:  78189103, 2
// prints: 78189103, 3

var so = nlapiLoadRecord('salesorder', rec.getFieldValue('createdfrom')) // load the related sales order

for(var i = 1; i <= so.getLineItemCount('item'); i++){ // print each sales order line's: id
  console.log(so.getLineItemValue('item', 'id', i));
}
// prints: 78189103_26
// prints: 78189103_2
// prints: 78189103_3
// prints: 78189103_4