I am trying to create custom python and javascript but would like to know where to insert it in frappe or erpnext.
When a client or future client or anyone goes to our website I would like to take that from javascript and push through python to do a backend command. I know decent python and some javascript and know to white list and allow for guests but I do not know where to place it here. I read that you need to put in a web form and doctype but where would you put in the python api to push to the server to do a command
I am doing several things for both the actual website business and also just to be a nerd and develop.
You can’t write any python code directly from website.
To write customize python code you’ve to create new custom app and place your python code inside custom app then call it using whitelisted function & frappe.call method.
To your answer, Thats, my hold up I think as of yet. Where do you place the python at in the custom app? do you place it in a new doctype because I do not see a place to put it. Or do you put it in the system files under the customAPP?
hi ,
can you please tell me what is #send
your button name in webform or something else
frappe.ready(function() {
$(‘#send’).off(“click”).on(“click”, function() { #send means??
frappe.call({
method: “custom_app.custom_app.xxx.yyy”,
callback: function(r) {
console.log(r.message);
}
});
Thank you so much for the reference you shared
Basically, I want to allow my guest users to resubmit the same old web form where the phone number field is unique I was looking if we can update the user record via web form using the PUT rest API please let me know your valuable opinion on this.
Thank you
You don’t necessarily need $('#send'). This is just one way to identify specific elements. In your case, you could use something like $('.btn-primary'). You can check the jQuery docs for more details.