Method in controller not get called

hello, i m making call to method in controller from js below is my js code:

frappe.ui.form.on("Employee", {
    onload: function(frm) {
	frappe.msgprint("script called");{
	"method": "employee.employee.generate_code",
	frappe.msgprint("method Called");
	console.log("value is");


and below is my code for

from __future__ import unicode_literals
import frappe
from frappe.model.document import Document

class Employee(Document):

def generate_document():
	j=frappe.db.sql("""SELECT Count(*) FROM tabEmployee""")
	frappe.msgprint("Number of employees are "+j+" in db")
	return j;

but i am not receiving any message-dialog from method and console message.any help will be appreciated.


Any error? Share the traceback

Seems there is an issue in the path, kindly check the entered path is correct.

@rohit_w can u please give general format for calling method.

Hi @Hardik_Mehta,

The format you have used is correct but I think method’s path is not correct, for more details check below example

JS code

###PY code