I'm trying to create multiple partial refunds from...
# suitescript
d
I'm trying to create multiple partial refunds from an invoice programmatically. Is
record.transform()
the only way to create a Credit Memo from an Invoice in SuiteScript? Is there a way to manually control the credit amount while still linking the Credit Memo back to the Invoice?
a
When you transform the Invoice to a Credit Memo you have full control over the transformed record, you can remove lines, change amounts, apply or not apply the credit memo, etc.
d
The only problem is that I'm moving partial refund from another system to Netsuite. When I did research, the only way to transform it into partial credit memo is to scale down the amount by ratio. However, it is causing mismatch due to rounding issue.
b
the transform is the only way to properly link the credit memo to the invoice. There is no requirement to do a ratio. Its just like creating any other transaction in that you can set any quantity or amount on each line. There isnt even a requirement that the amount equal the rate times the quantity. You should probably figure out how to do what you want in the ui first, then replicate that process in script
👍 1
d
Thank you battk. I will try it out!