1

NetSuiteは現在、発注書の明細項目入力中に「COPY PREVIOUS」機能を備えていますが、項目番号が変更されると、システムは説明と単価を項目マスター テーブルのデフォルト値で上書きします。スクロール可能なテーブルの前のレコードに対処する必要がある SuiteScript の課題について、誰か助けてもらえますか? つまり、データ入力中の注文書の 2 行目です。SuiteScript の前の行を参照するにはどうすればよいですか? ユーザーが別のアイテム番号を選択した後に、このコードを実行する必要があります。

ご協力いただきありがとうございます...

4

1 に答える 1

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....
            }
        }
    }

}
于 2012-12-08T04:02:13.187 に答える