ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Is frappe.form.link_formatters supposed to work


#1

I need to change the displayed value of a link field and I assumed that using frappe.form.link_formatters would solve the problem
I added this to the js file for my doctype

frappe.ui.form.on(‘MyDoctype’, {
onload: function (frm) {
console.log(“onload formatter test”);
frappe.form.link_formatters[‘My Doctype I want to Display’] = function(value, doc) {
console.log(“onload formatter for my doctype value=” + value + " doc.name=" + doc.name);
return value + “:” + doc.name;
}

}

In the debugger window on my browser I see the console print my messages so the function is definitely being called but my link field never changes.
Looking through these forums I find these 2 threads
This one talks about how it only works with read-only fields

Here some one posted a bug report a year ago describing exactly what I am experiencing.

Is this supposed to work.
I am using
erpnext 10.1.64
frappe 10.1.56