Hi Guys, I hope you are doing good, I'm trying to ...
# suitescript
m
Hi Guys, I hope you are doing good, I'm trying to delete a few sublist lines in aftersubmit Event of Netsuite Vendor Bill. but I'm getting this error? I would appreciate if you can share your thoughts with me on this Error
Copy code
{"type":"error.SuiteScriptError","name":"SSS_INVALID_SUBLIST_OPERATION","message":"You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.","stack":["anonymous(N/serverRecordService)","afterSubmit
Thanks, It is working fine
n
I'm going to guess you were deleting your list from the top down instead of bottom upwards and messing up your index?
m
Yes, I have changed it to bottom to top using
Copy code
for (var i = REC_LINES; i > 0; i--) {
👍 1