Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Globally Change Text Color Automatically for all or selected fields


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

Recommended Posts

Posted

The solutions to (Topic#181055) are close to what I need. Is there a way to make that color change happen to all fields or selected fields globally?

I have a field called (Type) with a value list of:

Invoice

Memo

The default text color is black. I want to display a different color if the value chosen is "Memo", and change back if the value is changed.

Thank you,

Lee

Posted

you would probably have to put transparent calculated fields on top with the color you want calculated by the choice.

The short answer is i see no way to do this on every field on a layout without putting some work in.

Posted

Thanks. Hmmm, I thought there must be a more efficient way. I'm surprised. Would creating some sort of script be better then?

We were looking for something where we would see the change in any or all layouts?

Kind of like when you are reading your email and all the unread mail in the list is in bold print, but once you open the mail it is in normal font. Is that typically overlapped fields technology?

Thanks for you response. I sure hope something else turns up. :

Lee

Posted

Thanks.

Took a while to get back to this.

Thanks for the calc.

Question:

Using your calc,

TextColor ( Type ;

Case ( Type = "Memo" ;

RGB ( 255 ; 0 ; 0 )

)

)

Is there a way to affect the color change for all or specific fields? I've been looking through my book and on the FM website but I haven't figured that part out. Can I make a function work on a list of fields in a calculation? Or do I need a script to loop through all the fields/objects, such as in Ocean West's Set Fields by Indirection! displayed on the FMF home page?

Thanks

Posted

A calculation in one field cannot affect the contents of another field (unless, of course, the other field is set to rely upon it). How many fields are we talking about? The example with unread e-mail would suggest only a few. A layout full of red/bold fields does not sound very appealing. What's the ultimate purpose here?

Posted

A layout full of red/bold fields does not sound very appealing

: I'd have to agree with you on that.

There are about a dozen fields I'd like display in a gray font so that the records which are memos appear '[color:gray]dimmed.'

So I went back and used your calc in each field definition which worked great. I figured out how to nestle in the expressions of fields already using calculations, but I still can't seem to make it work for the date and time fields.

Product Name =

TextColor (

Case( Product Serial Number = Inventory::Serial Number; Inventory::Product Name ; "" )

;

Case ( Type = "Memo" ;

RGB ( 100 ; 100 ; 100 )

) )

I thought about creating display fields for the date and time, which would have been fine for the report except I would lose my formatting options; I use two date fields, i.e. Sat 11/11. And using display fields doesn't help on the Form layout. So I'm kind of stuck there.

I realize font color is not a huge problem, but eventually when I show this to my boss it will matter. Thanks for your help I really appreciate it.

Posted

Well, text formatting functions work on text. With that many fields, perhaps you should go with Stuart's suggestion, i.e. cover up the real fields with calculated, non-enterable fields. The good news is it can all be done with one repeating calculation field; the bad news is you need to do date/number formatting yourself in the formula - but that's not too complex (see attached).

Untitled.fp7.zip

Posted (edited)

Well shut me up! Now yer jus showin off! :worship:

Thank you, it looks great. I'm gonna have to chew on it for a while. I'm telling you, the more I learn the more I learn there is a lot more to learn.

My first question is: What does the global field ( - ) do? :

Cheers

Edited by Guest
Posted

the more I learn the more I learn there is a lot more to learn.

Same here - I'm afraid that doesn't change.

What does the global field ( - ) do?

Nothing, really - it's just a separator.

Posted

Oh boy, next question: Why would we need a field to use as a separator? And specifically, what I was wondering was, in the part of your calc,

Let ( [

text = Choose ( Get ( CalculationRepetitionNumber ) [color:red]- 1 ; ),

is the hyphen referring to the field named ( - )? Or is it subtracting 1 from the repetition reference. Since there are no parameters to set for the ( Get ( CalculationRepetitionNumber ), I'm a bit lost. I wished I could see how functions, calculations and scripts work in action step by step. Sure would make things a lot easier . :

Thanks

Posted

Oh boy, indeed...

We don't NEED a field to use as a separator. I just like to see fields (in Define Database) separated into logical groups. In this case, the fields above the separator hold REAL data; the field below the separator is a calculation for display purposes only.

The hyphen you refer to is a minus sign. You cannot refer directly to a field named "-" in a calculation - and you get a warning saying so when you define such field.

The best way to see how a calculation works step by step is to follow it step by step, in the order of evaluation. If you're not sure about a step, break it out into a separate field (or into a variable, using the Let() function), and see what it does.

Posted

Although you can't use an invalid field name in a calculation, you can still use these separators for other things. They are great for Developer use - creating temp relationships, holding text (for display in report headings) set via script and so forth. Consider its use carefully and be sure it won't ever be needed in a calculation. But its existance can mean one less field elsewhere at times. :wink2:

LaRetta

This topic is 6585 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.