当社のnetsuite環境でsuitscript 2.0スクリプトを作成しました。 RESTletを使用してアクセスしています。Suitcript 2.0設定クーポンとパートナーコード
このスクリプトは、さまざまなフィールドを含む受注を作成します。それは正常に動作しますが、クーポンコード値またはパートナーコードを設定できません。両方に対して同じエラーが発生します。内部IDを使用しており、クーポンコード自体も試しました。
エラー:
{
"type":"error.SuiteScriptError",
"name":"INVALID_FLD_VALUE",
"message":"You have entered an Invalid Field Value 18 for the following field: couponcode",
"stack":[
"<anonymous>(N/record/recordService.js)",
"setSalesOrderData(adhoc$-1$debugger.user:71)",
"saveSaleOrder(adhoc$-1$debugger.user:17)",
"<anonymous>(adhoc$-1$debugger.user:107)",
"<anonymous>(adhoc$-1$debugger.user:6)"
],
"cause":{
"type":"internal error",
"code":"INVALID_FLD_VALUE",
"details":"You have entered an Invalid Field Value 18 for the following field: couponcode",
"userEvent":null,
"stackTrace":[
"<anonymous>(N/record/recordService.js)",
"setSalesOrderData(adhoc$-1$debugger.user:71)",
"saveSaleOrder(adhoc$-1$debugger.user:17)",
"<anonymous>(adhoc$-1$debugger.user:107)",
"<anonymous>(adhoc$-1$debugger.user:6)"
],
"notifyOff":false},"id":"","notifyOff":false
}
}
のRestletコード:
var objRecord = record.create({
type: record.Type.SALES_ORDER,
isDynamic: true
});
/* add other values.....*/
objRecord.setValue({ fieldId: 'couponcode', value: 538 });
var recordId = objRecord.save({
enableSourcing: false,
ignoreMandatoryFields: false
});
を... –
こんにちは、私たちの問題でsuitescript2のサポートを見て時間を割いてくれてありがとう@erictgrubaugh。 0は来るのが難しいです。プロモーション内部IDを使用してマルチユースクーポン(このクーポンの内部IDを取得するにはどうすればよいですか)と、クーポンの内部IDを持つシングルユースクーポンを試しました。それでも同じエラーが発生します。 SOを作成するときにコードを適用しようとしているため、N /レコードを使用しています。 –
var objRecord = record.create({ タイプ:record.Type.SALES_ORDER、 isDynamic:true }); /*他の値を追加する..... */ objRecord。setValue({ fieldId: 'couponcode'、 値:538 }); var recordId = objRecord.save({ enableSourcing:false、 ignoreMandatoryFields:false }); –