可以使用客户端脚本,尤其是在现场变更功能。
此代码是不完美的,但应该可以帮助您上手,请确保您在采购订单交易部署这样的:
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....
}
}
}
}