ExploreConsulting / netsuite-fasttrack-toolkit-ss2

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

Add support for setting sublist values for dynamic records #20

Closed johnogle222 closed 5 years ago

johnogle222 commented 5 years ago

setSublistValue isn't defined on dynamic records. This detects if we're in dynamic mode and switches up how the values are set accordingly.

If it is in dynamic mode, we first make sure we've selected the right line before calling setCurrentSublistValue.

ShawnTalbert commented 5 years ago

This is also a great idea - has made me a bit nervous to implement in the past. Since NFT surfaces what appears to be an Array-Like structure I've worried if the 'current line' approach would break down for some use cases? Can you think of any use cases where we'd run into trouble by pretending the sublist is a random access array-like object if we're in dynamic mode (and hence forced into a single "active" line pointer?

ShawnTalbert commented 5 years ago

I've adapted your approach in the perhaps poorly named branch feature/shippingaddress-on-cashsale-line and tried to include some other use/edge cases.