How to change field color based on the field value calculation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 07:13 AM
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.
- Labels:
-
Incident Management
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2022 04:45 AM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 06:51 AM
Take a look at the contents of OOTB table [sys_ui_style], there you find beautiful javascript code samples.