ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
ラインレベルの税金コードを更新するサンプルコード
適用
製品: NetSuite 2024.2
シナリオ
ラインレベルの税金コードを更新するためのサンプルコード。
解決策
SuiteScript 1.0:
function beforeRecordSubmit(){
var updateShipTaxCode = 1;
var count = nlapiGetLineItemCount('item');
for(var i=1; i<=count; i++){
var itemrec = nlapiGetLineItemValue('item', 'taxcode', i);
if(itemrec != '-Not Taxable-'){
var updateShipTaxCode = 0;
}
}
if(updateShipTaxCode == 1){
nlapiSetFieldValue('shippingtaxcode', '-7'); //or -8, depending on the internal id used by '-Not Taxable-'
}
}
SuiteScript 2.0:
function beforeRecordSubmit(){
var updateShipTaxCode = 1;
var count = objRecord.getLineCount({
sublistId: 'item'
});
for(var i=1; i<=count; i++){
var itemrec = objRecord.getSublistValue({
sublistId: 'item',
fieldId: 'taxcode',
line: i
});
if(itemrec != '-Not Taxable-'){
var updateShipTaxCode = 0;
}
}
if(updateShipTaxCode == 1){
//Where objRecord is the record being edited
objRecord.setValue({
fieldId: 'shippingtaxcode',
value: '-7', //or -8, depending on the internal id used by '-Not Taxable-'
ignoreFieldChange: true
});
}
}
タグ付けされた:
0