help. I have a 2.0 map reduce script in which I am...
# suitescript
n
help. I have a 2.0 map reduce script in which I am performing a record.copy({options}) on credit memo transactions which are sometimes applied, partially applied or completely open. In cases where the record.copy({options}) is performed on a credit memo which is applied to something like an invoice , I am looping through the 'apply' sublist on the credit memo and setting the 'apply' field on the 'apply' sublist to false. I am still getting an error message on the record.save({options}) line on 124: "One or more of the bills or invoices has had a payment made on it since you retrieved the form" Any thoughts? code snippet attached. Thank you
Will record.copt({options}) only work with transactions that are completely open? Should I just used record.create({options}) and create a new credit memo with the field values from the original credit memo?
context: we have a custom built store credit system in our ecommerce webstore which creates credit memos to NS. when a store credit on our ecommerce store is partially used or expired, that store credit (credit memo in NS) is voided (in the M/R script I invoice the original credit memo and perform and inventory adjustment to reverse the GL impact of the credit memo for clean record keeping) and a mew store credit on our ecommerce store is created for the remained of the original store credit , which is then synced to NS
s
Copying records in Netsuite tends to copy more than you actually want it to
n
just realized I was missing a record.commitLine after the recordsetCurrentSublistValue was performed (for working with dynamic mode true) . going to try that now
That was it! cheers