Hi, Does someone know how to solve it?
# suitescript
a
Hi, Does someone know how to solve it?
s
As usual, @battk already 'solved it' in your screenshot.
a
hmm, I see var customerRefund = record.create({ type: record.Type.CUSTOMER_REFUND, isDynamic: true, defaultValues: { entity: customerId, cred: creditMemos[0]?.id } }); I'm already using defaultValues, but I still got 0 for apply
s
creditMemos[0]?.id
doesn't look very confident there will actually be an id there - so hardcode an id there that you know should be valid for testing.
also, you'll have to confirm that
cred
is the param name - I don't remember off the top of my head so confirm that is correct. Also, NS isn't entirely consistent on which records support defaulting the
apply
sublist in this way.
👍 1