ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
スクリプトを用いてファイルのフォルダ名を取得する
適用
製品: NetSuite 2023.1
シナリオ
スクリプトによって特定のファイルのフォルダ名を知りたい。このシナリオでは、nlapiLoadRecordまたはrecord.loadを使用して名前フィールドの値を取得します。
解決策
以下はファイルキャビネットの特定のファイルのフォルダ名を取得するサンプルコードです。
SuiteScript 1.0
function getFolderName(){
var file = nlapiLoadFile(8401); //8401 is the internal id of one of your files in your file cabinet var folderid = file.getFolder(); //load folder object var folderObj = nlapiLoadRecord('folder', folderid); //get field value var foldername = folderObj.getFieldValue('name'); nlapiLogExecution('DEBUG','Folder Name',foldername);
}SuiteScript 2.0
function getFolderName(){
var file = file.load({
id: 8401 }); //8401 is the internal id of one of your files in your file cabinet
var folderid = file.folder; //load folder object var folderObj = record.load({
type: record.Type.FOLDER, id: folderid
}); //get field value var
foldername = folderObj.getValue({
fieldId: 'name'
});
log.debug({
title: 'DEBUG', details
タグ付けされた:
0