ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Not found : The resource you are looking for is not available


#1

While using simple select query to fetch data, system gives me error as “The resource you are looking for is not available” in my custom App.

Below is my sample code

++
In PY file

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

class TaskTracker2(Document):

    @frappe.whitelist()
    def get_data():
         return frappe.db.sql("""select name from `tabDepartment`""")
        # return 123;

+++
In JS file

//Call API to get Task Info
	frappe.call({
		method: 'task_management.task_management.doctype.task_tracker_2.task_tracker_2.get_data',
		callback: function (data) {
			console.log(data); 
		}
	})

What’s wrong here???


#2

Try to keep your whitelisted method out of the class declaration and indent it towards the left.


#4

Its done…

Its due to minor syntax error in py file…

Thanks!