I’m trying run a script using custom script document, but it’s not working.
When I paste the same script on browser console this work as well, yes, I cleared browser cache to test the custom script. I’m using Maintenance Visit Purpose doctype on custom script document.
You have to select the parent doctype to apply custom script for any child add or remove trigger.
Make sure that you have selected “Maintainance Visit” (as it is the parent of “Maintenance Visit Purpose”) and then add your custom script.