ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
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.
SuiteScript2.0の「Custom Module Call Undefined」エラーを解決
適用
製品: NetSuite 2023.2
シナリオ
SuiteScript 2.Xでカスタムモジュールを呼び出すと、エラー「Custom Module Call Undefined」が表示されます。
解決策
SuiteScript 2.0のカスタムモジュールを呼び出す場合、コードをきれいなフォーマットにすることで未定義のエラーを回避することができます。
次のカスタムモジュールはきれいなフォーマットになっていません。
define(['N/error', 'N/file', 'N/format', 'N/https', 'N/record', 'N/render', 'N/runtime', 'N/search', 'N/xml'],
function(error, file, format, https, record, render, runtime, search, xml)
{
function execute(scriptContext)
{
var cmsearch = search.load(
{
id: 'customsearch42'
});
log.debug(
{
title: "Start"
});
var resultsSet = cmsearch.run();
var results = resultsSet.getRange(0, 999);
for (var i = 0; results != null && i < results.length; i++)
{
var tranId = results[i].getValue(
{
name: "tranid"
});
var total = results[i].getValue(
{
name: "amount"
});
log.debug("total", tranId);
log.debug("total", total);
}
}
return {
execute: execute
};
});
以下のカスタムモジュールはきれいにフォーマットされています。
define(['N/error', 'N/file', 'N/format', 'N/https', 'N/record', 'N/render', 'N/runtime', 'N/search', 'N/xml'],
function(error, file, format, https, record, render, runtime, search, xml) {
function execute(scriptContext) {
var cmsearch = search.load({
id: 'customsearch42'
});
log.debug({
title: "Start"
});
var resultsSet = cmsearch.run();
var results = resultsSet.getRange(0,
タグ付けされた:
0