技术开发人员

问题描述 投票:0回答:1

创建计划脚本,要从项目子列表上的标准记录中获取值,我该怎么做?

function execute(scriptContext) {

   var poid = runtime.getCurrentScript().getParameter("custscriptbb1_mga_po_id");


   var objRecord = record.load({ 
       type: record.Type.PURCHASE_ORDER, 
       id: poid,
       isDynamic: false,
       });

   var itemvalue = objRecord.getValue({
        fieldId: 'item'
    });

   var rate = objRecord.getValue({
    fieldId: 'item'
   });


log.debug("itemvalue: "+ itemvalue + "rate  "+rate);
netsuite suitescript
1个回答
0
投票

要从子列表中读取数据,您需要使用record.getSublistValuerecord.getCurrentSublistValue,其中参数应如下所示。

{
  sublistId: 'item',
  fieldId: 'item',
  line: LINE_NO
}

注意: getCurrentSublistValue只能在动态模式下使用,必须先使用selectLine方法选择该行。

© www.soinside.com 2019 - 2024. All rights reserved.