I need to apply a Customer Refund to a Credit Memo...
# suitescript
s
I need to apply a Customer Refund to a Credit Memo but the refund
apply
sublist has > 10,000 lines - and my desired credit memo is beyond that first 10,000. Anyone tackled this before and have a clever solution on how to do this in script?
m
Do you face any issue when you try to loop over the lines?
b
use the
cred
or
credits
defaultValue
use the
credits
or
cred
defaultValues
s
cred
didn't work - in contrast to
inv
for payments/invoices. It appears
cred
only works if the credit memo is within that first 10,000 based on my testing
In fact, the original script was using
cred
defaultValues for quite some time - until we hit this 10,000 applicable transactions count
but thanks @battk. I'm quite stumped on this one at this point!
b
credits is the other choice
e
Have you tried loading the XML representation of the record and then parsing the XML?
s
I haven't looked @Eric B but I'd be surprised if that renders more than 10,000 lines in the XML?
@battk using
credits
looks promising - I thought
credits
and
cred
were synonymous here - how are you coming up with both those values and are you aware of how they differ exactly? I don't see any of this documented in my help searches
darn, using
credits: 1234
results in nothing being selected for the apply sublist, tried both standard and dynamic mode too.
wait, I think we have success - using the combination of
credits
(not
cred
) then manually setting
apply= true
seems to work. So you don't get the 'auto selection' but it did seem to filter the apply list down to just the single CM indicated via defaultValues
b
looks like you found out what credits does, credits filters the credits sublist to the ids you set
it doesnt actually apply them
i believe i originally learned about credits from the older suitescript 1 docs which actually documented it
now i just copy how
nsapiGetRecord
works to see how NetSuite generates its client side list of supported default values and records