Hi,
My Py code
@frappe.whitelist()
def make_test(source_name):
test = frappe.new_doc(“Todo”)
test.description = “test”
test.save()
return test
my Js Code
frm.add_custom_button(__("Make Test"), function() {
frappe.call({
method: 'erpnext.custom.make_test',
args: {
"source_name": frm.doc.name
},
callback: function(r) {
var doclist = frappe.model.sync(r.message);
msgprint(doclist[0].name);
},
});
});
Error I get in console
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
frappe.request.call/<()
desk.min.js:1449
n.Callbacks/i()
jquery.min.js:2
n.Callbacks/j.fireWith()
jquery.min.js:2
z()
jquery.min.js:4
.send/c/<()
I am not sure what is wrong. anyone?