I am trying to create a lead custom doctype with an action button. I wrote the js script for the button in the clientside doctype and used frappe.call() tried to fetch out the code which I wrote in serverside script doctype using @frappe.whitelist() but I m not able to fetch it. But if I write the same thing in the py. file it works but that I can’t be done in a live instance…
Thanks In Advance
Share your client and server scripts, so others can help you.
This way I created a button in the clientside script doctype
This way I wrote whitelist code in the serverside script doctype
If you want the script to be run for ‘guest’ accounts(without login), you can set the “Allow Guest” checkbox in the server script.
I am not certain if the decorator @frappe.whitelist() is allowed to be used within the server script.
Thank you for your reply but the issue is I wanted to write frappe. whitelist() code as required… moreover, it’s a production server I can’t change the code so any idea where I can write whitelist code?
You should write an API in sever script and call from your js file.
That is true but to call the python whitelist function we need to use frappe. call() and for that, we need to give a method which is the location of the python file but the issue is I m writing python code in serverside script doctype from the frontside form so how can I give a method(Location) of that form in the client-side script doctype from frontside form to fetch that python function?
You can get them in
you can get them from
KeyError if there is no
x in args
None if there is no
x in args
and there is examples downside in