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

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

Recommended Posts

Posted

I have found the function "If ( CODE="1" ; TextColor(NAME;RGB(150;0;0))". I have a field "name" and a field "code". If "code"=1 I want to turn the "name" field text red. I cant get this to work any ideas? TIA

Ivan

Posted

Actually, I believe you can. With FM7 you can use that as an auto-enter calculation on your Name field.

Be sure to unclick right under 'by calculation' the box that says "Do not replace existing value." In this way, the text color will continually change depending upon the Code.

Posted

code=1

changecolor field "If (CODE=1 ; TextColor ( NAME ; RGB (250; 0 ; 0 ) ) ; TextColor (NAME ; RGB ( 0 ; 0 ; 0 ) ) )"

Only thing that changes is the contents of "word field" "name" in changecolor field. If only I could make "name field" = "changecolor field"

Posted

create script to:

Set name field = changecolor field.

Need a "SetField" command in the calculation collection, this would be a snap.

Ivan

Posted

Why are you using another field called changecolor? This calculation attached to your Name field will allow the name to change to reddish when Code = 1. TextColor(Name; (Code = 1) * 9830400 ). This is the most efficient way to code it. Just be sure to unclick right under 'by calculation' the box that says "Do not replace existing value." That's the key.

This next one will only display the name in red if Code = 1 otherwise the field will remain empty. If(Code; TextColor (Name; RGB ( 150; 0; 0) )). I had to throw this in ... I really like it with auto-enter! It is nicer than requiring validation on a field. Instead of insisting a field remain empty, it quietly and sweetly removes the data instead. This auto-enter ability (in FM7) replaces many script steps and validation requirements, such as formatting for phone numbers, etc. This particular calc (not allowing data in a field) makes me smile and I have come up with all kinds of uses for it. wink.gif I have Manager's box for 'Manager Comments Only'. If Privilege Set isn't Manager, the User's entry doesn't stick.

Detlev said... but I had to reenter the values, after applying the auto enter calculation to the text field.

Unclick 'Do Not Evaluate...' in the calculation dialog. But you are correct, I believe, in that you'd need to force a recalculation if you wish to change the color of the text in a standard field (pre auto-enter calculation).

You could loop with one script step: Set Field [Code, Code]. It doesn't matter what field it sets but Code (being numeric 1) might be quicker. Even Replace Contents (same calc). Simply setting any field to itself will force an update according to the record's auto-enter calculation.

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