Hi everyone! When editing a Customer Refund, I ca...
# suitescript
e
Hi everyone! When editing a Customer Refund, I can select a line in the Apply sublist and
setSublistValue
. But when creating (not editing) a Customer Refund, I get
setSublistValue is not a function
. Why? Any help would be great.
My code:
Copy code
for (var k = 0; k < customerRefundRecord.getLineCount('apply'); k++) {
    if(customerRefundRecord.getSublistValue({sublistId: 'apply', fieldId: 'doc', line: k} == creditMemoID)){
      try {
          customerRefundRecord.setSublistValue({sublistId: 'apply', fieldId: 'amount', line: k, value: totalPayment})
      } catch (e) {
          console.log(e);
      }
        break;
    }
}
m
It could be that the record is in
dynamic
mode so you'll need to use the
.selectLine()
and
setCurrentSublistValue()
versions.
e
Thanks @Mike Robbins!!! It think thats exactly the issue
z
I had exactly the same issue with workflow action... i was sure that record is in standard mode, but no. There is a flag record.isDynamic to determine in what mode the record is loaded