I am trying to create a custom doctype with a action button. What I did was I created an action type of server action and action is to call an whitelisted function, e.g. custom_module.custom_function.myaction. It runs fine if my whitelisted function doesn’t accept parameter.
However, I need the whitelisted function to be able to accept parameters when we press the action button. So I changed the my function to:
@frappe.whitelist()
def myaction(message):
…
But I have no idea how I can pass the parameter from the action. When I tried custom_module.custom_function.myaction(message), and I am trying to pass the field ‘message’ in my doctype, it just have a message of:
Failed to get method for command custom_module.custom_function.myaction(message) with module ‘custom_module.custom_function’ has no attribute ‘myaction(message)’