Basically I need part of the code in my ValidateLi...
# suitescript
j
Basically I need part of the code in my ValidateLine to only run when adding a new line item (not when editing one)
r
jen: Have you tried using the Line Init event then check if the item field is blank to determine that it is a new line. Line Init should trigger when the user selects a line item regardless if it is new or an existing one.
j
I need something to happen as part of ValidateLine for this item though, and by that point the item field will not be blank
z
Can you run it post sourcing on the item field? Or are you changing items on lines after then are added?
r
What I as thinking was, you have a function on the Line Init that checks if there is already an item on the line or not. If there is set the global variable to 'Edit' and if not 'Add'. Then on your validate line function you can check the value of the global variable.