Netsuite 如何在使用客户端脚本2.0创建物料收据时设置库存详细信息?

Netsuite 如何在使用客户端脚本2.0创建物料收据时设置库存详细信息?,netsuite,Netsuite,我试图从项目接收记录的行项目中获取子列表子记录,但其返回值为空 /** *@NApiVersion 2.x *@NScriptType ClientScript */ define(['N/error', 'N/currentRecord'], function (error, currentRecord) { function pageInit(context) { var rec = currentRecord.get(); rec.selectLi

我试图从项目接收记录的行项目中获取子列表子记录,但其返回值为空

/**
 *@NApiVersion 2.x
 *@NScriptType ClientScript
 */
define(['N/error', 'N/currentRecord'],
  function (error, currentRecord) {
    function pageInit(context) {
      var rec = currentRecord.get();
      rec.selectLine({ sublistId: 'item', line: 0 });
      var inventoryDetailSubRecord = rec.getCurrentSublistSubrecord({sublistId: 'item', fieldId: 'inventorydetail' });
      // inventoryDetailSubRecord object comes up with null.
    }

    return {
      pageInit: pageInit
    };
  }
);

inventoryDetailSubRecord对象应提供inventoryDetailSubRecord。

客户端脚本可以读取子记录,但不能写入它们
getCurrentSublistSubrecord
如果子记录不存在,则创建该子记录

从文件中

客户端脚本不能在当前记录上创建子记录,并且只能以只读方式访问当前记录上的现有子记录。客户端脚本可以从当前记录中删除子记录


客户端脚本可以读取子记录,但不能写入子记录
getCurrentSublistSubrecord
如果子记录不存在,则创建该子记录

从文件中

客户端脚本不能在当前记录上创建子记录,并且只能以只读方式访问当前记录上的现有子记录。客户端脚本可以从当前记录中删除子记录