So if you click the "+ Insert" button on an existi...
# suitescript
n
So if you click the "+ Insert" button on an existing line item, when you select an item from the drop down the validateDelete function is triggered on client scripts. Any idea why that would trigger a delete when you are inserting a line?
e
Inspecting the
Insert
button shows that the click handler calls
item_machine.insertline()
which then calls
item_machine.clearline()
which in turn calls
item_machine.deleteline()
which triggers the
validateDelete
entry point
mindblow 1
So to clear out the fields on the line you're inserting, they're effectively deleting the existing line before initializing a new one
NS Build
2023.1.17.31238
n
@erictgrubaugh interesting, so its a newer thing? Also, if you need to handle some changes on delete of an actual line instead of this insert, there is no way to tell the difference between inserting a line and actually removing a line
e
oh idk if it's new, I just gave my build number for comparison
n
oh haha got ya
Yeah so if you need to say set a header field when a line is deleted it could be inaccurate because you could be inserting lines
e
And yeah, it would seem that way; I don't know how you would distinguish without relying on some of the internal properties that these functions use, and that is not a reliable thing to do
n
Yeah, knowing that almost makes that function really useless to some degree
Thanks for the info and response. 👍
1
r
I try not to look behind the curtain.
netsuite 2