RE: Infinite loop with alert() inside a fieldChanged() ClientScript (with Chrome only !)
Hi Everyone,
I have a strange behavior on a SuiteScript ClientScript.
Here is my code :
But with Chrome only, I got an infinite loop of alert. I think this is because alert() method try to remove focus, and the validateField method is fired when the focus is removed from the field.
How can I solve that ?
I tested the script with IE and Firefox, even if the alert pop-out twice, it is not as disturbing than with Chrome.
Any help would be appreciate ?
Regards,
Loïc
I have not experienced this personally before and am not sure this would solve it, but you could try using dialog.alert (/app/help/helpcenter.nl?fid=section_4497744851.html) via the N/ui/dialog module replacing the native JavaScript alert with the stylized NetSuite equivalent.
Hey, thanks a lot ! Even if it is not the perfect solution (the user have to click two time on the “OK” button), it is acceptable (it does not looks like a massive bug). Here the code I used :
I’ll try to contact NetSuite for a more “suitable” solution.
more “complete” dialog/ui based solution : https://www.abaci-us.com/suitescript-2-0-dialog-confirm/