Hi - Hopefully someone has seen this before, but I...
# suitescript
s
Hi - Hopefully someone has seen this before, but I am trying to do some line validation in a Client Script - this script is attached to a suitelet. The script is on the sublistChanged function, however it is being called when the suitelet loads, which is in turn causing a loop. Does anyone know how to stop this from happening? I need it to fire whenever a line is changed, but after the page is rendered.
s
Use the validateLine entry point instead of sublist changed.
✔️ 3
s
I tried this, but this still fires when the suitelet loads..
I have solved this by getting the initial amount of sublist lines i am setting on pageInit - then passing this through to the validateLine to only execute code when all lines have been created
s
Is there a reason you aren't filling out the sublist on the suitelet itself, should be better performance wise to do it there rather than pageInit.
s
That's a good point - I cant actually remember why I offloaded it to the CS now! I will move it into the SL, thanks!