ディスカッション
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.
RESTletを使用してクーポンコードが適用されている注文書を作成する
適用
製品: NetSuite 2020.1
シナリオ
ユーザーは、クーポンコードが適用されている注文書を外部システムで作成したいと考えています。
解決策
サンプルJSONパッケージ:
{"internalid":"1158","promocode":"Test Promotion 1","couponcode":"LE-Z4A","item":"6"}
SuiteScript 1.0:
function TestRestLet(dataIn){ nlapiLogExecution('DEBUG', 'data', JSON.stringify(dataIn)); var record = nlapiCreateRecord('salesorder', {recordmode:'dynamic'}); record.setFieldValue('orderstatus', 'B'); record.setFieldValue('entity', dataIn.internalid); record.selectNewLineItem('item'); record.setCurrentLineItemValue('item', 'item', dataIn.item); record.commitLineItem('item'); if(dataIn.couponcode != null) { nlapiLogExecution('DEBUG', 'Promo code and coupon code: ', dataIn.promocode + ' ' + dataIn.couponcode); record.setFieldText('promocode', dataIn.promocode); record.setFieldText('couponcode', dataIn.couponcode); } return nlapiSubmitRecord(record); }
SuiteScript 2.0:
function TestRestLet(requestBody){ log.debug('data', requestBody); var rec = record.create({ type: record.Type.SALES_ORDER isDynamic: true }); rec.setValue({ fieldId: 'orderstatus', value: 'B
タグ付けされた:
0