I ran into a very similar issue in MAS 9 while converting a PR customization from Java to Bean Scripts.
In my case, the button was on a child table in the PR application (PR Lines tab). I had created an APPBEAN.PR script with a function matching the mxevent, enabled mxe.script.allowbeanscript, and checked "Allow Invoking Script Functions?". However, the script never executed even though the same approach worked for buttons elsewhere in the application.
After quite a bit of troubleshooting, I found that the problem was not the script itself, but the UI XML context.
The button was defined inside a <buttongroup> on a child table. What finally made it work was explicitly setting the correct targetid and datasrc/sigoptiondatasrc so that the event was routed back to the proper bean context.
For example, I had something similar to:
<buttongroup datasrc="MAINRECORD" id="prlines_prlines_table_2" sigoptiondatasrc="prlines_prlines_table">
<pushbutton label="Punch Out" mxevent="PUNCHOUT" targetid="MAINRECORD"/>
</buttongroup>
Once the button context was corrected, my existing bean script started firing without any additional changes.
My final setup was:
-
mxe.script.allowbeanscript = 1
-
Automation script named APPBEAN.PR
-
"Allow Invoking Script Functions?" enabled
-
Function name matching the mxevent
-
Correct targetid
-
Correct datasrc / sigoptiondatasrc on the button or button group
If your script works from menus or header buttons but not from a pushbutton inside a child table, I would recommend checking the XML context first. In my case, the missing/incorrect targetid and datasource configuration were the reason the event was never reaching the bean script.
I hope this helps.