Netsuite 无法创建入站装运

Netsuite 无法创建入站装运,netsuite,Netsuite,无法进行入站装运 { type: "error.SuiteScriptError", name: "SSS_INVALID_SUBLIST_OPERATION", message: "You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add

无法进行入站装运

{
   type: "error.SuiteScriptError",
   name: "SSS_INVALID_SUBLIST_OPERATION",
   message: "You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.",
   stack: [
      "anonymous(N/serverRecordService)",
      "inboundResults(/SuiteScripts/inboundResults.js:40)"
   ],
   cause: {
      type: "internal error",
      code: "SSS_INVALID_SUBLIST_OPERATION",
      details: "You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.",
      userEvent: null,
      stackTrace: [
         "anonymous(N/serverRecordService)",
         "inboundResults(/SuiteScripts/inboundResults.js:40)"
      ],
      notifyOff: false
   },
   id: "",
   notifyOff: false,
   userFacing: false
}

 var objRecord1 = record.load({
    type:"receiveinboundshipment", 
    id: 2,
     isDynamic:true
});

var receiveItemCount=objRecord1.getLineCount('receiveitems');





var lineNum = objRecord1.selectLine({
    sublistId: 'receiveitems',
    line: 2
});

objRecord1.setCurrentSublistValue({
    sublistId: 'receiveitems',
    fieldId: 'receiveitem',
    value:  true,
    ignoreFieldChange: true
});

objRecord1.setCurrentSublistValue({
    sublistId: 'receiveitems',
    fieldId: 'quantitytobereceived',
    value:  1,
    ignoreFieldChange: true
});


objRecord1.commitLine({
    sublistId: 'item'
});

var recordId3 = objRecord1.save({
    enableSourcing: true,
    ignoreMandatoryFields: true
});

可从脚本访问记录ReceiveInboundShipping,字段receiveitemQuantityToBeeceived正确无误

唯一不正确的是,您在子列表项上执行提交操作,而不是在接收项上执行提交操作

objRecord1.commitLine({
    sublistId: 'receiveitems'
});
您应该将子列表“item”替换为“receiveitems”,它应该可以工作


祝你好运,

记录接收边界发货可以从脚本中访问,并且接收项目接收数量字段是正确的

唯一不正确的是,您在子列表项上执行提交操作,而不是在接收项上执行提交操作

objRecord1.commitLine({
    sublistId: 'receiveitems'
});
您应该将子列表“item”替换为“receiveitems”,它应该可以工作

祝你好运