ディスカッション
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サンプルコード: カスタムレコードを更新
適用
製品: NetSuite 2023.1
シナリオ
この記事では、PHP Toolkit 2012.2を使用してPHPでカスタムレコードを更新する方法を示します。
解決策
カスタムレコードを更新するサンプルコードは以下となります。
require_once '../NSPHPClient/NetSuiteService.php';
$service = new NetSuiteService();
//カスタムレコードの種類の新規レコードを作成
//カスタムレコードのフィールドのインスタンスを作成
$customStringFieldList = new StringCustomFieldRef();
$customStringFieldList->internalId = "custrecord_name";
$customStringFieldList->value = "Test from PHP toolkit";
$customSelectFieldList = new SelectCustomFieldRef();
$customSelectFieldList->value = new ListOrRecordRef();
$customSelectFieldList->value->internalId = 5;
$customSelectFieldList->internalId = 'custrecord_payment_method';
$basicCustomRecord = new CustomRecord();
$basicCustomRecord->name = "PHP Toolkit 2012.2";
$basicCustomRecord->internalId = "7"; // 更新したいカスタムレコードの内部ID
$basicCustomRecord->recType = new RecordRef();
$basicCustomRecord->recType->internalId = "14"; // レコードの種類の内部ID (カスタマイゼーション>リスト、レコードおよびフィールド >レコードの種類
$basicCustomRecord->customFieldList = new CustomFieldList();
$basicCustomRecord->customFieldList->customField = array($customStringFieldList, $customSelectFieldList);
$updateRequest = new UpdateRequest();
$updateRequest->record = $basicCustomRecord;
$updateResponse = $service->update($updateRequest);
var_dump($updateResponse);
if (!$updateResponse->writeResponse->status->isSuccess) {
echo "UPDATE ERROR";
exit();
} else {
echo "UPDATE SUCCESS, id " . $updateResponse->writeResponse->baseRef->internalId;
}
?>
タグ付けされた:
0