ディスカッション
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 2022.1
シナリオ
ユーザーが請求書レコードの入金ボタンをクリックしても、「部門」、「クラス」、「場所」のフィールドは、適用された支払いには引き継がれません。
解決策
ページの初期化時にこれらのフィールドを設定するクライアントスクリプトを書きます。
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/search','N/currentRecord'],
function(search,rec) {
function pageInit(context) {
var customerPayment = rec.get();
var numOfInvoices = customerPayment.getLineCount('apply');
for (var i = 0; i < numOfInvoices; i++){
var applyingInvoice = customerPayment.getSublistValue({
sublistId: 'apply',
fieldId: 'apply',
line: i
});
if (applyingInvoice) {
var invoiceID = customerPayment.getSublistValue({
sublistId: 'apply',
fieldId: 'internalid',
line: i
});
var fields = ['department', 'class', 'location'];
var columns = search.lookupFields({
type: search.Type.INVOICE,
id: invoiceID,
columns: fields
});
var j = 0;
for (var key in columns) {
var fieldValue = columns[key];
customerPayment.setValue({
fieldId: fields[j],
value: fieldValue,
forceSyncSourcing: true
});
j++;
}
break;
}
}
}
return {
pageInit: pageInit
};
});
免責事項
ここに記載されているサンプルコードは、法律で認められている最大限の範囲で、いかなる種類の保証もなく、「現状のまま」で提供されています。Oracle+NetSuite社は、開発者がそれぞれの開発プラットフォームにサンプルコードを実装したり、独自の Web サーバー構成を使用したりする際に、個々の成功を保証するものではありません。
タグ付けされた:
0