Shelby Owens
11/21/2024, 2:59 PMCeligo AI
11/21/2024, 2:59 PMAI generated answer (using internal Slack threads):To insert a line in the item sublist on a sales order and set the price level with SuiteScript, you can use the
selectNewLine, setCurrentSublistValue, and commitLine methods. Here is a sample code snippet:
javascript
var salesOrderRecord = record.load({
    type: record.Type.SALES_ORDER, 
    id: 'your_sales_order_id',
    isDynamic: true,
});
salesOrderRecord.selectNewLine({
    sublistId: 'item'
});
salesOrderRecord.setCurrentSublistValue({
    sublistId: 'item',
    fieldId: 'item',
    value: 'your_item_id' // replace with your item id
});
salesOrderRecord.setCurrentSublistValue({
    sublistId: 'item',
    fieldId: 'price', // price level field
    value: 'your_price_level' // replace with your price level
});
salesOrderRecord.commitLine({
    sublistId: 'item'
});
var recordId = salesOrderRecord.save();
Please replace 'your_sales_order_id', 'your_item_id', and 'your_price_level' with your actual sales order id, item id, and price level respectively.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/21/2024, 3:00 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859813631
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851379395
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850718915
Celigo AI
11/21/2024, 3:00 PM