This might be a bit late but I’ve had great success by storing all my scripts in a smartobject. I load them using a stored proc in the initialize event. The proc lets me replace strings in the file while loading. This allows me to write one script and if I need to target a particular control for instance, I can supply the name of that control for each view I use it in. The major benefit of doing this is I can write the code in VS Code, save to a file and use bulk insert to write directly to the database. Bit more setup when using Azure SQL but all possible.