How to change field color based on the field value calculation

Balaram7
Kilo Sage

Hi all,

 

We have a requirement in scoped application. 

There are three fields 1. Net Amount 2. Additional Charges 3. tax amount.

if the calculation of these three fields are equal to Total amount. Then Another field Named Balance field need to be displayed as "OK " and field color needs to be displayed as yellow else it should be displayed as "pending" and field color need to be displayed as "Red " and set the field value as "Pending".

 

Please help me with the  best way to achieve this.

 

Thank you,

Balaram.

6 REPLIES 6

Will this work as well for a calculated field I have that is the sum of other fields.  I want the calculated field to be green if the sum is one of 6 numbers. If not then change the field color to red.

 

here is what I have to add up the fields to get the Total.

(function calculatedFieldValue(current) {

// Add your code here
var totalrate=current.u_amt_1+current.u_amt_2+current.u_amt_3+current.u_amt_4+current.u_amt_5+current.u_amt_6+current.u_amt_7+current.u_amt_8+current.u_amt_9+current.u_amt_10;
return totalrate;
// return the calculated value

})(current);

Oleksiy Kosenko
Tera Expert

Take a look at the contents of OOTB table [sys_ui_style], there you find beautiful javascript code samples.