ディスカッション

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.

サンプルSuiteletスクリプト>複数のファイルをアップロードする

編集済:Jun 2, 2025 2:48PM SuiteCloud / カスタマイズ

適用

製品:  NetSuite 2024.2

シナリオ

複数のファイルをアップロードしてファイルキャビネットのフォルダーに保存するSuiteletのサンプルスクリプトは以下となります。このスクリプトはSuiteScript 1.0で作成されており、SuiteAnswers ID: 82126 - SuiteScript 2.0 > Suitelet > Upload multiple filesと同じような内容となります。

解決策

Suiteletのサンプルスクリプトは以下となります。  

function uploader(request, response)

{
   

if (request.getMethod() == 'GET')

{
       

var form = nlapiCreateForm('Attach Multiple Files');
       

var entityID = nlapiGetContext().getUser();
       

var entityName = nlapiLoadRecord('customer', entityID);
       

//顧客IDを表示
var entityField = form.addField('custpage_entity', 'text', 'Customer').setDefaultValue(entityName.getFieldValue('entityid'));
       

//ファイルフィールドを追加
var fileField1 = form.addField('custpage_file1', 'file', 'Select 1st File');
       

var fileField2 = form.addField('custpage_file2', 'file', 'Select 2nd File');
       

var fileField3 = form.addField('custpage_file3', 'file', 'Select 3rd File');
       

//ファイルフィールドを必須に設定
fileField1.setMandatory(true);
       

fileField2.setMandatory(true);
       

fileField3.setMandatory(true);
       

form.addSubmitButton();
       

form.addResetButton();
       

response.writePage(form);
   

}

else

{
        //var entity = request.getParameter("custpage_entity");

タグ付けされた:

ようこそ!

サインイン

完全な詳細を表示するには、サインインしてください。

登録

アカウントがありませんか?ここをクリックして始めましょう!

リーダーボード

コミュニティの達人

第2四半期 (4月~6月 2026)

今週のリーダー

今月のリーダー

歴代リーダー