Change form, in-line button > jelly > script > ajax - onclick not firing?

Roger11
Giga Guru

I've added a new button via UI Macro scripting to provide a + button next to the parent field on a change record to provide functionality to create a new change record based on a template, link the new change to the existing change and to navigate to the new change for the user to complete it. 

Roger11_0-1722928195769.png

Conditionals work fine, button gets shown when I need it to be shown, but clicking it does nothing and I think I have tried everything - but obviously something eludes me.

Roger11_1-1722928513334.png

I've created the server-side script include with gs.info statements in but nothing is hitting the logs. It's probably something obvious, I'm just not seeing it.
Inspecting the button in the browser shows that everything is where it is supposed to be.

 

Roger11_3-1722928886244.png

 



1 ACCEPTED SOLUTION

Roger11
Giga Guru

I've managed to fix it and get it working.

Still no idea what was wrong with it. I pared it back to pretty much what was in this article 

I ripped out all the script and just put in something that simply updated the description field instead. That worked, so I moved on from there and started reinstating stuff, that continued to work. Then I added the AJAX script call and that also worked (threw an error, but it was visibly failing so I could figure out what to fix next). After that it was just a matter of reinstating more code, trying things out.

The url redirect from a UI macro was my last challenge and that was just window.open(url, '_self').

maybe it was just a typo that was causing things to just stop and not error? Not sure. Chuck Tomasi's Jelly tutorials could do with a revision to include how UI macros are debugged today - still haven't worked out how to do that other than updating fields visible on the screen.

View solution in original post

1 REPLY 1

Roger11
Giga Guru

I've managed to fix it and get it working.

Still no idea what was wrong with it. I pared it back to pretty much what was in this article 

I ripped out all the script and just put in something that simply updated the description field instead. That worked, so I moved on from there and started reinstating stuff, that continued to work. Then I added the AJAX script call and that also worked (threw an error, but it was visibly failing so I could figure out what to fix next). After that it was just a matter of reinstating more code, trying things out.

The url redirect from a UI macro was my last challenge and that was just window.open(url, '_self').

maybe it was just a typo that was causing things to just stop and not error? Not sure. Chuck Tomasi's Jelly tutorials could do with a revision to include how UI macros are debugged today - still haven't worked out how to do that other than updating fields visible on the screen.