My custom script giving error 404 not found

Hello,

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/events.py
29%20PM

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 customapp.events.getallme in your custom script, use customapp.customapp.events.getallme

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?
37%20PM

I tried using “customapp.customapp.events.getallme”, 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 frappe.call in here

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

Regards
@hrwx

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