https://netsuiteprofessionals.com logo
m

MUHAMMAD MUBUSHER ASLAM

04/29/2022, 5:44 AM
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

NElliott

04/29/2022, 8:20 AM
I'm going to guess you were deleting your list from the top down instead of bottom upwards and messing up your index?
m

MUHAMMAD MUBUSHER ASLAM

04/29/2022, 11:06 AM
Yes, I have changed it to bottom to top using
Copy code
for (var i = REC_LINES; i > 0; i--) {
👍 1