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?

mmascitto Beginner Asked on September 16, 2019 in SuiteScript.
Add Comment
9 Answers

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:

RE: How to Invoke Button Function with Client Script

And here’s the client script:

RE: How to Invoke Button Function with Client Script

Any thoughts? At this point, I’m just trying to get it to step into the function for the button.

Beginner Answered on September 16, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.