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???