My custom script giving error 404 not found


I created the following custom script:

in the server side I have a application with the name ‘customapp’

this is the file sitting in /home/myerpuser/mybench/apps/customapp/customapp/

and this is the error I get “Not found” and in the console log I see the 404 not found error

does anybody know what I’m missing?

@rohit_w do you see something missing?

This error comes up often when there is an error in the py file… run getallme from bench console just to check if py is good.

Instead of in your custom script, use

looks like the py is good I ran the function and it is returning the string without any error. I only found how to run it using bench execute, do you know how I can do it using the bench console?

I tried using “”, but still getting the 404 not found error

Only other thing I can think of is are you running in Production mode or Development ( from bench start) ? If Production you have to sudo supervisorctl reload for py changes to kick in.

Hey @alexsilva,

Try this following, include your in here

frappe.ui.form.on("Stock Entry", {
    validate: function(frm) {{
            method: "function path",
            args: {
            callback: function(r) {}


1 Like

@root13F, @hrwx, @vijaywm thanks for your answers, I found my error, when I tried to install the ‘customapp’ I did:

bench new-app customapp
bench install-app customapp

the commands that fixed it were

bench --site mysite install-app customapp
bench --site mysite migrate