I am trying to use frappe.get_last_doc(doctype)
to get last created doc via custom script
frappe.call({
method:"frappe.get_last_doc",
args: {doctype:"Sales Invoice"},
callback: function(r) {
console.log(r.message);
}
})
Error
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
response = frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 54, in execute_cmd
is_whitelisted(method)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 76, in is_whitelisted
raise frappe.PermissionError('Not Allowed, {0}'.format(method))
PermissionError: Not Allowed, <function get_last_doc at 0x7f69c9af16e0>