Hi,
I want to add some CSS on ERPNext Scripting Report columns. Any help would appreciate
[here is example] (sbkolate.com: Ability to Color cells based on cell value Reports) to change font color of script report.
just add code into js file
Regards,
Sambhaji Kolate,
New Indictrans Technologies Pvt Ltd.
Hi Sambhaji Kolate,
Many many thanks for your efforts your trick work for me but I need is:
if (columnDef.id == “Company”) {
var company_doc = frappe.get_doc(‘Company’, {name: value});
value = “<span style=‘color:’” + company_doc.color + “‘;font-weight:bold’>” + value + “”;
}
but company_doc returned only specific fields. however I also tried this:
frappe.db.get_value(‘Company’, {name: value}, [“color”], function(message){
console.log(message);
});
But it throws me error: frm undefined
Nice to hear you that this tricks work for you.
Also get_doc will not work on javascript, you need to use get_value
or frappe.call
Example:
frappe.call({
'method': 'frappe.client.get_value',
'args': {
'doctype': 'Delivery Note',
'fieldname': 'customer',
'filters': {
'name': 'DN-00003'
}
}
,
callback: function(r){
msgprint(r.message.customer);
}
});
Regards,
Sambhaji Kolate,
New Indictrans Technologies Pvt Ltd.