I have a working Custom App to add features to Desk, not DocType form. Now one of the new features is to add a button, onclick() will call a function in custom_app.js (of which is already in hooks.js’ app_include_js.
For example in list_view.js I added a button,
< button class = “btn btn-messages-whatsapp” onclick=“sendWhatsApp();”>
The custom_app.js has a traditional JS function, for example,
Thank you @TurkerTunali and @avc for your pointers. I thought Client Script only works when we are editing DocType forms; now it seems it is possible to also work in Desk outside of Forms!
Hi @avc unfortunately this code is not working in v13.49.
The code is there in browser Source, but the button just won’t show up. @TurkerTunali 's code will show a button (taken from List), and from the doc it says 1 button can be added. I need to add more than 1 button.
I prefer to use your approach because from your code I can call vanilla JS (so I don’t have to be an expert in Client Script and can still get something done urgently).
Any idea on why the button is not showing?
Here is what I have done myself, by modifying list_view.js:
Again, my trouble is I can’t get the buttons to register a proper event, and call vanilla JS functions.
I’m sorry @avc! The button is added outside of the list! Ha ha ha.