I’m trying to fire events from the Set Public and Set Internal buttons on this list edit widget. However, no joy! I’m using a Presenter on a text field whose code is below.
cs.event_action is only usable in your backend code, e.g. main.js.
You need to make a call from your frontend code using this.trigger_action() to a new method in your backend code named action_{something}.
Not easy to paste a full example here as there are three parts, but have a look at the help for main.js → action_xxxxx() in the right hand help bar for a full example.
So your HTML code will call the frontend function (e.g. fireInternalEvent), which you already have. But that then needs to call a backend function (e.g. action_fireInternalEvent), which can be passed any relevant data (probably just record ID), and it can then fire the actual event on the record.
So I have got thus far, but it’s still not firing the event. If I set up the same event reference with cs.fire_event in an event action it fires and is logged by detective.
I am just using 1 button to try and get the event to fire:
If not try also putting a console.log() above your this.trigger_action line, to try and narrow down if the issue is the HTML firing the frontend function, or the frontend function trying to call the backend function.
You should also be able to see the request triggered by your this.trigger_action() in your Browser’s Network debugging panel, to double check something is happening.