Why would a basic record transformation of a sales...
# suitescript
j
Why would a basic record transformation of a sales order to an invoice through a map/reduce script miss the shipping cost? We have an issue where we have quite a few invoices that are missing the shipping cost associated with the sales order, leaving a balance on related customer deposits.
Copy code
const invoiceRec = record.transform({
        fromType: 'salesorder',
        fromId: salesOrderId,
        toType: record.Type.INVOICE,
        isDynamic: true
      });

const invoiceID = invoiceRec.save();