ExploreConsulting / netsuite-fasttrack-toolkit-ss2

NFT for SuiteScript 2.X
74 stars 20 forks source link

Improve user experience for removeLine() #67

Open ShawnTalbert opened 2 years ago

ShawnTalbert commented 2 years ago

If you have a need to remove multiple lines from a record sublist, it can get tricky since NetSuite reassigns line indexes.

This is a spike to give thought to how we might make this easier for users via NFT.

ShawnTalbert commented 2 years ago

the simple answer that handles many use cases is to just loop backwards.

i.e. use lodash _.forEachRight or similar xxxRight methods. This should preserve indexes as it steps backwards through a line collection.