How to add a custom js script in suitecrm-8?

I want to add a custom script. I understand I can do it by adding the path to the file in the scripts section of the angular.json file But example

"scripts": [ ..., "core/app/shell/src/custom-scripts/one-time.js"]

What command should I execute so that this custom script is integrated into the output bundle?

I don’t think those are scripts to go into a front-end package. Those scripts are the ones you run with commands like

yarn run build:core

So it’s basically stuff to build the front-end, not stuff to go into the front-end bundle. You can see by the existing scripts, they’re not js files, they’re npm and ng commands.

You probably need to build an entire front-end extension as described here:

but this will only make sense if you know how your code will run, how it will be triggered, and it can’t be the familiar JS / JQuery-style event triggers - it has to be Angular actions tied to the specific SuiteCRM front-end…

Thanks for answering. The purpose of including this custom script is to try to apply custom validations on some fields. I plan to interact with the DOM in order to achieve this goal. Specifically to handle this scenario

https://community.suitecrm.com/t/how-can-i-add-custom-validation-to-a-custom-field-in-suitecrm-8/91723?u=mario.martinez

I don’t think you can play outside the framework like that…

You need to do it the Angular way. Which I can’t teach you, because I don’t know.

There is already front-end code for validations, you can find it in several places. If you need some extension to that code, you really need to think in terms of “front-end extension”, not JS hack.

In the short run, this makes small customizations much harder. In the long run, we get a consistent front-end where things don’t fall apart chaotically for no good reason…