ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
NetSuite の始め方| N/record: Column.idプロパティ
前の記事NetSuiteの始め方 | Understanding SuiteScript 2.x Modulesで、レコードの操作に使用されるSuiteScriptモジュールおよびN/recordモジュールNetSuiteの始め方 | N/record Module Overviewを学習しました。次に、N/record: Column.id Propertyのメンバーの1つを詳しく確認します。
IDプロパティーオブジェクトは、それが表す列の内部IDを返します。この内部IDは、検索作成スクリプトで列を定義する際にフィールドIDを指定するときに使用するのと同じ値です。
たとえば、フィールドIDが 'entityid'のカラムを含めると、そのカラムの.IDプロパティーは 'entityid'を返します。
- タイプ:プロパティは文字列型です。
- 読取り専用: Column.idの値は変更できません。読取り専用であり、列の信頼できる識別子として機能します。
- 目的:このプロパティを使用すると、検索で定義された列のフィールドIDに簡単にアクセスできます。このプロパティは、検索結果を動的に処理または表示する場合に便利です。
スクリプトの例: Column.id
/**
* @NApiVersion 2.x
* @NScriptType ScheduledScript
*/
define(['N/record', 'N/search', 'N/log'], function(record, search, log) {
function execute(context) {
// 特定の列を持つ顧客の検索の作成
var customerSearch = search.create({
type: search.Type.CUSTOMER,
columns: ['entityid', 'email'] // column IDs we want
});
// 検索を実行し、各結果を処理
customerSearch.run().each(function(result) {
// 結果内の列をループ
result.columns.forEach(function(col) {
// 列の内部IDとその値を記録
log.debug('Column ID: ' + col.id, 'Value: ' + result.getValue(col));
});
return true; // continue processing more results
});
}
return { execute: execute };
});
このスクリプトでは:
- このスクリプトは顧客を検索し、entityid列とemail列を尋ねます。
- 結果ループ内では、col.id
Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced
----
- NetSuite Admin Corner | New to NetSuite
- Explore the NSC Webinars Category
- Join our poll and share your ideas! We want to know what you think. Don't forget to comment and make your voice heard!
- Expand your NetSuite knowledge by joining this month's Ask A Guru Live about Suitebuilder . RSVP on this event now!
タグ付けされた:
0
