Wondering if anyone has encountered this. I am tr...
# suitescript
m
Wondering if anyone has encountered this. I am transforming a Sales Order into an Invoice in a Scheduled Script. I am getting an INVALID_TRANS_TYP error upon the saving of the invoice, but the invoice record is saving.... I can't figure it out. Seems like it should be so simple
let newINV = record.transform({
               
fromType: record.Type.SALES_ORDER,
               
fromId: newSOId,
               
toType: record.Type.INVOICE,
               
isDynamic: true,
           
});
           
let newINVId = newINV.save();  //Errors on this line, but the invoice is attached to the Sales Order
            `log.debug('Invoice',
Invoice Id = ${newINVId}
);`            
return newINVId;
Any thoughts?
w
Do you maybe have some after-submit user event or workflow/-action on your invoice that is throwing the error?
m
Yep that's it. A super old script from our Implementers... Thank you!
🎉 1