Custom Field Color


It is possible from Custom Script to change the color of a custom field from a custom doctype?

Custom field : nr_apt
Custom doctype : sesizari


Any idea?

What do you mean by changing the color? Are you referring to the Color field or Status indicator color?

Which one is the easiest to implement it?

The best is status indicator but also an static Color Field.

This is how the Status field color can be customized:

Good Thanks !

And the color field?

RIght now the color field is only used for Gantt and Kanban, maybe we should enable it for other views as well.


If you want to pick a color then you can go for color field

how can i do this? any idea?

To change color of the field you can go with what @netchampfaris suggested you can refer the above instead of doc.status you use our own custom field

And this needs to be added in Custom Script?

I have added to add the below script in custom script

frappe.ui.form.on(‘Sesizari’){validate: function(frm) {
if(doc.tip_colaborare===“Deschis”) { return [(“Contract in Derulare”), “green”];
} else {
return [
(doc.tip_colaborare), {
“Reziliat”: “red”,
“Contrat in Derulare”: “green”,
“Succesiv 12 luni”: “orange”,

		}[doc.tip_colaborare], "status,=," + doc.tip_colaborare];


and I get this erorr :slight_smile:

SyntaxError: Unexpected token {
at Class.setup (
at _f.Frm.setup (
at _f.Frm.refresh (
at Class.load (
at Object.with_doc (
at Class.show_doc (
at Object.with_doctype (
at Class.make (