ディスカッション

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.

ファイル添付つきメッセージをケースレコードに添付するPHP Toolkit 2012.2サンプルコード

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

適用

製品:  NetSuite 2023.1

シナリオ

ユーザーは、添付ファイル付きのメッセージを追加したい。このサンプルコードは、PHP Toolkit 2012.2を使用して添付ファイル付きのメッセージを追加する方法を示します。

解決策

以下のサンプルコードは、PHP add Webサービス操作を使用してサポートケースに添付ファイルを含むメッセージを追加。

require_once '../NSPHPClient/NetSuiteService.php';

$service = new NetSuiteService();

// ファイルをロード

$imgPath = 'C:\Documents and Settings\hguerrero\My Documents\HelloWorld.doc'; //specify the file path

$imgContents = base64_encode(file_get_contents($imgPath)); //get the contents of the file

$file = new File();

$file->folder = new RecordRef();

$file->folder->internalId = "-15";

$file->name = 'HelloWorld.doc';

$file->fileType = '_WORD';

$file->attachFrom = '_computer';

$file->content = $imgContents;

// リストにファイルを追加

$messageMediaItem = new MessageMediaItemList();

$messageMediaItem->mediaItem = $file;

// メッセージを作成しフィールドをに入力

$message = new Message();

$message->author = new RecordRef();

$message->author->internalId = "1";

$message->author->type = 'customer';

$message->recipient = new RecordRef();

$message->recipient->internalId = "384";

$message->recipient->type = 'contact';

$message->messageDate = '2012-03-23T00:50:39.301Z';

タグ付けされた:

ようこそ!

サインイン

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

登録

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

リーダーボード

コミュニティの達人

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

今週のリーダー

今月のリーダー

歴代リーダー