【问题标题】:How to set inventory details when creating item receipt with client script 2.0?使用客户端脚本 2.0 创建项目收据时如何设置库存详细信息?
【发布时间】:2020-01-15 05:48:52
【问题描述】:

我试图从收货记录的行项目中获取子列表子记录,但它返回null。

/**
 *@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
    };
  }
);

inventoryDe​​tailSubRecord 对象应该提供库存详细信息子记录。

【问题讨论】:

    标签: netsuite


    【解决方案1】:

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

    来自文档;

    客户端脚本可能不会在当前记录上创建子记录,并且仅限于对当前记录上的现有子记录进行只读访问。客户端脚本可能会从当前记录中删除子记录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-14
      • 2015-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多