Steve Rolfe
07/27/2018, 6:23 PMRunning client scripts on server side in case of subrecord is actually by design, it's been implemented that way ever since (since 2013)The problem I encountered is that my script was failing all over the place when addresses became a subrecord of a transaction because N/currentRecord wasn't available when they choose to run your client-side script on the server-side This workaround will prevent your client-side script from running server-side if you return from your functions when this is true:
const SCRIPT_DISABLED = typeof document != 'object';