Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Change border colour of Text field based on Date Field - Calculated Field

Avatar

Level 2

I have a list of documents that require periodic reviews. I would like to have a Calculated field that adds a Red border on the Title field when the Review Date field is =< Today, and Amber if the Review Date field is Today -1 Month.

JS is not allowed hence the need for a Calculated field.

Title - Text Filed Review Date - Date Field Todays Date 21-11-2022
Document 1 25-10-2022 Red border because it is past Review Date
Document 2 12-12-2022 Amber border because it is within 1 month of Review Date
Document 3 20-02-2023 Nothing as it is over 1 month from Review Date

 

Thanks in advance
Pete

1 Accepted Solution

Avatar

Correct answer by
Level 4

You can achieve this by putting javascript something like below in the calculate event of the field whose border color need to change:

 

if(CallFunctionToCompareDateWhichReturnTrueOrFalse(putCurrentDate,DateofYourField)){
this.border.edge.color.value="255,0,0";
}else{
this.border.edge.color.value="255,255,0";
}

View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

You can achieve this by putting javascript something like below in the calculate event of the field whose border color need to change:

 

if(CallFunctionToCompareDateWhichReturnTrueOrFalse(putCurrentDate,DateofYourField)){
this.border.edge.color.value="255,0,0";
}else{
this.border.edge.color.value="255,255,0";
}