Jump to content
Server Maintenance This Week. ×

Color Text After Find


This topic is 7012 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have a script that finds records by looking at a "date" field that are less than 3 years old. After the find, I want to be able to color the text red if any record that will be older than 3 years 6 months from now, blue if it will be older than 3 years 3 months form now, and yellow if it will be older than 3 years one month from now. Help is appreciated

Link to comment
Share on other sites

I would create a calculated field that changes the color based upon your criteria.

For example: A calculated field with this:

TextColor ( Text_Field ;

Case(Date_Field < get ( currentdate ) - (3.5*365) ;

RGB ( 255;0;0 ) ;

RGB ( 0;0;0 )

)

)

would text to red if date in above range, or black if not. You could add another case to change to blue, between black and red. (I have not verified the test for the date, I could be 180 degrees off, I always have to test)

Using this approach you do not have to add anything to your scripted find. Just find what you want and put this calculation on the resulting layout. This approach has the disadvantage that the user will not be able to edit the text you need colored. If you need this do a replace with the same criteria to change the text color and then let the user edit the field.

Link to comment
Share on other sites

This topic is 7012 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.