我有一個用於發票記錄(newRecord)的用戶事件腳本,存儲爲var record
。在沙盒和瀏覽器控制檯中,我使用一直運行的record.getSublistFields('sublist_name')
。Netsuite SuiteScript 2.0 getSublistFields方法不起作用
我們剛剛將沙箱中的用戶事件腳本移植到生產環境中,儘管沒有對腳本進行任何更改,但突然getSublistFields('sublist_name')
在腳本的上下文中不起作用。該方法仍然可以正常使用控制檯。
下面是來自debugger-
$ record.getLineCount('item')
> 2
$ record.getSublistFields('item')
>
$ record.getSublistFields()
> {"type":"error.SuiteScriptError","name":"SSS_MISSING_REQD_ARGUMENT","message":"DeferredDynamicRecord.getSublistFields: Missing a required argument: sublistId","stack":["<anonymous>(N/record/recordService.js)","<anonymous>()","buildBodyData(usereventscript.js$72$debugger.user:118)","buildData(usereventscript.js$72$debugger.user:74)","_put(usereventscript.js$72$debugger.user:37)","_afterSubmit(usereventscript.js$72$debugger.user:14)","<anonymous>(usereventscript.js$72$debugger.wrap:18)","<anonymous>(usereventscript.js$72$debugger.wrap:12)","<anonymous>(usereventscript.js$72$debugger.wrap:24)","<anonymous>(usereventscript.js$72$debugger.wrap:1)"],"cause":{"type":"internal error","code":"SSS_MISSING_REQD_ARGUMENT","details":"DeferredDynamicRecord.getSublistFields: Missing a required argument: sublistId","userEvent":"aftersubmit","stackTrace":["<anonymous>(N/record/recordService.js)","<anonymous>()","buildBodyData(usereventscript.js$72$debugger.user:118)","buildData(usereventscript.js$72$debugger.user:74)","_put(usereventscript.js$72$debugger.user:37)","_afterSubmit(usereventscript.js$72$debugger.user:14)","<anonymous>(usereventscript.js$72$debugger.wrap:18)","<anonymous>(usereventscript.js$72$debugger.wrap:12)","<anonymous>(usereventscript.js$72$debugger.wrap:24)","<anonymous>(usereventscript.js$72$debugger.wrap:1)"],"notifyOff":false},"id":"","notifyOff":false} (SYSTEM_LIBS$debugger.sys#3387)
幾行具體而言,這是一個創紀錄的發票,並且可以從調試代碼中看到,其他常規SuiteScript 2.0命令工作正常。
在此先感謝您的幫助!請告訴我是否有任何其他信息可以提供。