In a custom app I have a field with fieldtype button. And I want to add action to it. I want to run a method then return a value to fill a data field and check the checkbox when the button pressed.
To my understanding there are 3 options:
- Server script: using the button options I can connect it to a method on doctype_name.py file.
- Client script: using doctype_name.js directly add action to the button.
- Both: using js to make frappe.call to server method and return the action.
But using #1 I can’t check the box and fill the data field.
Using #2 I can’t run the server method.
Using #3, the frappe.call method path is not recognized because the py file is in the same doctype directory.
What is the best way to do this?