record.tranform 将订单转移到项目收据引发错误

record.tranform Transfer Order to Item Receipt throws error

我正在尝试根据转移单创建物料收据。我能够转换记录,但是当我去保存它时,我得到了错误

You must enter at least one line item for this transaction.

我的密码是

var data = JSON.parse(params.data);
//get tranfser order
var lookupResults = search.lookupFields({
    type : search.Type.ITEM_FULFILLMENT,
    id : data.id,
    columns : 'createdfrom'
});
var transferOrderId = lookupResults.createdfrom;
log.debug("Transfer Order", JSON.stringify(lookupResults.createdfrom));
//Create Item Receipt from transfer order
var itemReceipt = record.transform({
    fromType    : record.Type.TRANSFER_ORDER,
    fromId      : transferOrderId[0].value,
    toType      : record.Type.ITEM_RECEIPT
});

log.debug("Data", JSON.stringify(itemReceipt));
itemReceipt.save({
    ignoreMandatoryFields : true
});

数据日志显示此项目收据有行。但出于某种原因,NetSuite 抛出了错误。我做错了什么?

您可能必须在要接收的每个项目行上勾选 itemreceive。还要确保您正在处理已发货的履行