SuiteScript ソリューションや統合の開発、またはトランザクションレコードのトラブルシューティングを行う際には、サブリストフィールドのデータ型を確認する必要がある場合がよくあります。フィールドが select、checkbox、currency、float、またはその他の型のいずれであるかを把握することで、より信頼性の高いスクリプトを作成し、実行時エラーを回避できます。
この例では、Sales Order の Item サブリストにあるフィールドのメタデータを確認する方法を示します。
使用例
/**
* @NApiVersion 2 .1
* @NScriptType ScheduledScript
*
* Use the Column.type property to determine the data type of
* sublist fields at runtime. This is useful when building
* generic scripts or troubleshooting field behavior.
*/
define(['N/record', 'N/log'], (record, log) => {
function execute(context) {
//--------------------------------------------------------------------------
// STEP 1: Load an existing Sales Order
// Replace 123 with a valid Sales Order Internal ID
//--------------------------------------------------------------------------