currentRecord.getCurrentSublistValue returns undef...
# suitescript
j
currentRecord.getCurrentSublistValue returns undefined in item fulfillments client script ------------------------------------------------ I am using code like the following in a client script, in both the fieldChanged and validateField entry points: _columnValue = currentRecord.getCurrentSublistValue({ sublistId: 'item', fieldId: 'units' }); It works in all transactions except item fulfillments, where it returns undefined. Is there something about item fulfillments that I am missing? This is a separate topic, but I've tried using an alternative method in item fulfillments, like this: if (_recordType === 'itemfulfillment') { const _sublistCurrentIndex = currentRecord.getCurrentSublistIndex({ sublistId: _itemSublistId }); _columnValue = currentRecord.getSublistValue({ sublistId: _itemSublistId, fieldId: targetFieldId, line: _sublistCurrentIndex }); } else { _columnValue = currentRecord.getCurrentSublistValue({ sublistId: _itemSublistId, fieldId: targetFieldId }); } This works fine in the fieldChanged entry point, but returns the "old" value of the target field in validateField -- i.e., the value that existed before my code reset it. I see the new value onscreen, but getSublistValue returns the old value.
b
the items on an item fulfillment are a list type sublist
with some fields being editable and some not
your units shouldnt be editable
j
Thanks for your reply. Didn't mean to imply that I am editing the units. They are just a criterion that I need to consider in my code. The column I am setting is Quantity.
The problem isn't around setting a value. It's that getCurrentSublistValue returns undefined for every column in the sublist.
b
you should be able to use getCurrentSublistValue on any of the editable fields
and for the others, you should be able to use getSublistValue, because you cant edit the uneditable ones