在 Suitescript 2.0 的 Suitelet 中使用 N/record
Using N/record in Suitelet in Suitscript 2.0
我正在尝试使用 Suitelet 中的 n/record 模块加载记录,但出现以下错误:
org.mozilla.javascript.EcmaError: TypeError: Cannot read property "SALES_ORDER" from undefined
* @NApiVersion 2.x
* @NScriptType Suitelet
*/
define(['./form', 'N/record'],
function(form, record) {
function onRequest(context) {
if(context.request.method === 'GET'){
var ratingForm = form.build(context);
var customRec = record.load({
type: record.TYPE.SALES_ORDER,
id: 18
});
这是一个表单,我想加载一条记录,并使用现有的 SALES_ORDER 记录预填充任何字段。
也许我需要用不同的方式解决这个问题?
更新您的 record.load
如下
var customRec = record.load({
type: record.Type.SALES_ORDER,
id: 18
});
您可以查看 this 所有支持的记录类型列表。
我正在尝试使用 Suitelet 中的 n/record 模块加载记录,但出现以下错误:
org.mozilla.javascript.EcmaError: TypeError: Cannot read property "SALES_ORDER" from undefined
* @NApiVersion 2.x
* @NScriptType Suitelet
*/
define(['./form', 'N/record'],
function(form, record) {
function onRequest(context) {
if(context.request.method === 'GET'){
var ratingForm = form.build(context);
var customRec = record.load({
type: record.TYPE.SALES_ORDER,
id: 18
});
这是一个表单,我想加载一条记录,并使用现有的 SALES_ORDER 记录预填充任何字段。
也许我需要用不同的方式解决这个问题?
更新您的 record.load
如下
var customRec = record.load({
type: record.Type.SALES_ORDER,
id: 18
});
您可以查看 this 所有支持的记录类型列表。