ディスカッション
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.
NetSuite 管理者ヒント |在庫詳細作成のある定期スクリプト請求書
請求書作成の自動化により、請求業務を合理化し、手動入力エラーを削減することができます。特に、シリアル番号やロット番号などの詳細な追跡が必要な在庫アイテムを処理する場合です。SuiteScriptを使用すると、アイテム・ライン内で在庫詳細を直接割り当てる機能など、このようなレコードをプログラムで柔軟に作成することが可能になります。
この記事では、SuiteScript 2.xの定期スクリプトを使用して、在庫詳細割当を含む請求書を作成する方法を示します。このソリューションは、シリアル管理またはロット番号付き在庫アイテムを使用し、特定の在庫番号に基づいて請求書を発行する必要がある企業に特に役立ちます。請求書の作成方法、アイテム・ラインへの移入方法、および在庫詳細サブレコードを使用した在庫番号の割当て方法を説明します。
サンプル・コード
/**
* @NApiVersion 2.x
* @NScriptType ScheduledScript
*/
define(['N/search', 'N/record'], function(search, record) {
function execute(scriptContext) {
// 1. Create Invoice Record
var recordObject = record.create({
type: record.Type.INVOICE,
isDynamic: true
});
// 2. Set Customer and Location
recordObject.setValue({ fieldId: 'entity', value: 7 }); // Replace 7 with actual customer ID
recordObject.setValue({ fieldId: 'location', value: 1 }); // Replace 1 with actual location ID
// 3. Add Item Line
recordObject.selectNewLine({ sublistId: 'item' });
recordObject.setCurrentSublistValue({ sublistId: 'item', fieldId: 'item', value: 58 }); // Replace 58 with actual item ID
recordObject.setCurrentSublistValue({ sublistId: 'item', fieldId: 'quantity', value: 1 });
recordObject.setCurrentSublistValue({ sublistId: 'item', fieldId: 'description', value: 'Created from script' });
recordObject.setCurrentSublistValue({ sublistId: 'item', fieldId: 'location', value: 1 });
recordObject.setCurrentSublistValue({ sublistId: 'item', fieldId: 'amount', value: 800 }); Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced
----
- NetSuite Admin Corner | New to NetSuite
- Explore the NSC Webinars Category
- Join our poll and share your ideas! We want to know what you think. Don't forget to comment and make your voice heard!
タグ付けされた:
0
