我在Suitescripts文件夹中有一个库文件。我想在我的Map / Reduce脚本中包含同样的内容。
我尝试通过在脚本定义中添加文件,但是出现未定义的错误。
define(['N/search', 'N/record', '/SuiteScripts/Date_Sent_From_SF_On_PO'],
function(search, record, dateSent) {
function getInputData() {
...
}
function map(context) {
...
var today_date = new Date();
var newDate = dateSent.Set_Date_Sent_From_SF_On_PO(today_date);
...
}
})
执行脚本时,其在函数Set_Date_Sent_From_SF_On_PO名称上引发未定义的错误。谁能帮我解决这个问题?谢谢
答案 0 :(得分:0)
除非您的库文件是用define函数构造的,否则应省略dateSent参数/参数。您仍然可以使用
define(['N/search', 'N/record', '/SuiteScripts/Date_Sent_From_SF_On_PO'],
function(search, record) {
function getInputData() {
...
}
function map(context) {
...
var today_date = new Date();
var newDate = Set_Date_Sent_From_SF_On_PO(today_date);
...
}
})