Anyone used the ns-internal functions clear_splits...
# suitescript
w
Anyone used the ns-internal functions clear_splits("machine name") and machine.copyLine()? (Clear all lines and copy a sublist line) I'm wondering if you can speak of how long you've been using it so that I can get a picture of how often NS might change those functions. I'd like to use them as they are very fast compared to looping through lines and removing them and the copyline is very quick too. Yes, I know that NS can change them at any time rendering my buttons inoperable.
👍 1
No takers? 😁
s
no, due to the undocumented and unsupported aspect. I'd be more likely to consider such shenanigans if I were working directly only for one company and hence took full responsibility.
👍 2
w
Which is my current situation. 😊
@stalbert copyline should be pretty trivial to duplicate but with acceptable code I would have to place the button on top of the sublist As I want it on the line, I'm already doing shenanigans with the DOM. Do you have any better ways?
s
I use the native APIs, albeit with the help of a library. For example I have
removeAllLines()
that IIRC was fast even though it used the documented suitescript apis.
for copying a line I'd generally use
Object.assign()
?
w
I couls probably loop through all the lines and delete them, as I assume your removeAllLines does? The issue I had with doing that was another client script that fired on each lineinit and was pretty slow. But I have sped that up, so it would probably be pretty 👌 now.
The ns-version skipped all other clientscripts
m
Can't use use
ignoreFieldChange
,
ignoreRecalc
etc?
w
Talking about removeLine, using ignoreRecalc unfortunately didn't help. Each removeLine still takes about a second to perform.
Comparing that to using clear_splits/Machine_clearmachine/Machine_removeAllLines which takes 150ms for the complete list.