Skip to main content

I need to add JavaScript code to run when a button is clicked on a screen I’m including through a Customization Project. (I’m using Acumatica 2022 R1)

I am able to do it by including a function using the JavaScript control, and then calling it from the Click or MouseDown inside the ClientEvents menu on the button’s properties.

I can also do it by entering the JavaScript code directly into the Click or MouseDown events.

I can confirm the JavaScript code runs, but the problem is that it runs when the screen is loaded, instead of when the button is clicked. Also, the code runs twice for some reason.

I was wondering if this may be caused by not following a right way to include JavaScript. I’d like to know what steps need to be followed if this is the case, or to learn from any suggestions any of you may have tried already to make JavaScript code work correctly on a button click.

Reply