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.