RE: How to Invoke Button Function with Client Script
I’ve added a button with a beforeLoad UE script. When the user clicks the button, it should create a new instance of a custom record. As I understand, you need a client script to handle the button click. I seem to be having trouble invoking my button function, though. I set the name of the function when I created the button in the UE script. Then I defined the named function in my client script. But when the button is clicked, the function in the client script is never invoked. Anyone know what I’m missing?
Initially, i figured out the problem was i wasn’t specifying the client script. I tried adding it with context.form.clientScriptFileId, but i kept getting an API version error. Maybe it’s deprecated? At any rate, i switched to context.form.clientScriptModulePath, like in your example. There’s no error anymore, but still, it’s not invoking the function in the client script when the button is clicked. I know because I have a log entry when it first enters the function in the client script, but the log never occurs.
Here’s the user event script:
And here’s the client script:
Any thoughts? At this point, I’m just trying to get it to step into the function for the button.