I am attempting to write a Restlet, using SuiteScript 2.0, for my company to create a new Sales Order. I found how to create a record.Type.Sales_Order and put in the minimums for now, but I have no idea on how to create an item for the Sales Order and include it in the SO so I can create the Sales Order.
Here is what I have so far (in a GET):
var salesOrder = record.create({
type: record.Type.SALES_ORDER,
isDynamic: true,
defaultValues: {
entity: param.customer_id
}
});
salesOrder.setValue('trandate', new Date()),
salesOrder.setText('orderstatus','Pending Fulfillment');
salesOrder.setValue('memo','Sales Order Generated from ' + param.customer_name);
salesOrder.save();
Do I create a new record of an item type and then add it to the sales order before saving? I have looked though the help section in netsuite.com but can't find anything with creating items for a sales order.
Thanks for any answers or places to look :)