我需要帮助才能将SALES_ORDER
转换为INVOICE
,但必须删除子列表项并添加其他值。
错误消息:未定义item_machine
基于分配给该问题的两个标签“ NetSuite”和“ SuiteScript 2.0”,我正在尝试回答。
下面的代码行是SuiteScript2.0文档上的现成示例(在Web上免费提供。)>
这会将“ Sales_Order”转换为“ ItemFulFillMent记录”,因此,您需要在以下代码中进行必要的更改。
var fulfillmentRecord = record.transform({
fromType: record.Type.SALES_ORDER,
fromId: salesOrderId,
toType: record.Type.ITEM_FULFILLMENT,
isDynamic: false
});
var lineCount = fulfillmentRecord.getLineCount('item');
for (var i = 0; i < lineCount; i++) {
fulfillmentRecord.setSublistValue('item', 'location', i, 1);
// here you can remove, add or modify item lines on ItemFulfillment.
}
var fulfillmentId = fulfillmentRecord.save();