【发布时间】:2019-01-17 06:06:48
【问题描述】:
我正在制作一个 usereventcript,它使用销售订单项目列表中的子字段计算费率。尝试保存和部署脚本会启动错误 无法评估脚本:{"type":"error.SuiteScriptModuleLoaderError","name":"UNEXPECTED_ERROR","message":"missing } after property list (SS_SCRIPT_FOR_METADATA#32)" "栈":[]}
/**
*@NApiVersion 2.x
*@NScriptType UserEventScript
*/
define(
[
'N/record'
],
function (record) {
/**
* @param {UserEventContext.beforeSubmit} context
*/
function beforeSubmit(context) {
//get taxcode
var taxcode = context.newRecord.getValue({
fieldId: 'taxcode'
});
if(taxcode !== 0 || taxcode !== 4){
// Gets the Total Amount
var amount = context.getValue.getValue({
fieldId: "amount"
});
// Gets the quantity of an item selected
var quantity = context.newRecord.getValue({
fieldId: 'quantity'
});
var rate_ = amount/quantity;
var newRate = context.newRecord.setValue({
fieldId : 'rate'
value : ('rate',rate_)
});
}
}
return {
// beforeSubmit: beforeSubmit,
};
});
【问题讨论】:
标签: netsuite suitescript suitescript2.0