2012-12-07 79 views
1

NetSuite当前有能力在采购订单上的行项目输入期间“复制上一个”,但在更改项目编号时,系统将覆盖描述和单位价格与来自物料主数据表的默认值。有人可以帮助我在SuiteScript中挑战,我需要在一个可滚动表格中解决前一个记录?即数据输入期间在采购订单上的第2行。如何引用SuiteScript中的上一行?在用户选择不同的产品编号后,我需要执行此代码。在采购订单条目中使用SuiteScript修改Netsuite UI

感谢您的帮助......

回答

0

可以使用客户端脚本,尤其是在现场变更功能。

此代码是不完美的,但应该可以帮助您上手,请确保您在采购订单交易部署这样的:

function fieldChanged(type, name, linenum){ 
    if(type == 'item' && name == 'item') 
    { 
     { 
      var currIndex = nlapiGetCurrentLineItemIndex('item'); //Get the current index, this is the total count of line items in the transaction 
      if(currIndex > 1) //You have to have at least two line items to be able to refer to the previous line item 
      { 
       var prev = currIndex - 1; 
       var itemNo = nlapiGetLineItemValue('item', 'item', prev); //This it the item number from the previous line item..Do whatever you want from here.... 
      } 
     } 
    } 

} 
相关问题