I've researching online on how to generate an invoice from a sales order through suitescript 2.0 but without any luck.
Could anyone shed a light on how to do this please.
Here's my situation: Order is placed through API SOAP and I want to auto-generate an invoice once the order is placed on Netsuite. Once the invoice is created, then email that invoice to the customer.
Use Suitescript 2.0 Record.transform. You can trigger it on a User Event - After Submit script if you want it to happen in real-time.
Example:
//Add additional code
...
var objRecord = record.transform({
fromType: record.Type.SALES_ORDER,
fromId: 107,
toType: record.Type.INVOICE,
isDynamic: true,
});
...
//Add additional code