Jump to content
Salesforce and other SMB Solutions are coming soon. ×

If Statement Question


sfiore
 Share

Recommended Posts

Hey All,

Can think today so hope you can all help: I want to create an If statement that is saying If field A is marked as problem, then turn field A the color red.

 

Now the marked area "Problem" is a list value..

 

any help would be appreicated.

Link to comment
Share on other sites

Please elaborate — when do you want the field to become red? Do you want it to be red any time the field's value is "problem"? Or do you only want it to become red when you run a script?

 

And do I correctly parse that the field with (or not with) the value "problem" is the same field that you want to become red whenever its value is "problem"?

 

Do I correctly guess that you mean the text color of the field, as opposed to the background color of the field? (There's a different technique if you want the background color of the field to change)

 

Assuming the above guesses & interpretations are on target and that Field A is a regular text field (and not a text calc field that obtains its value from the value of other parameters), set it to auto-enter calculation, unchecking the box that says "do not replace existing value", with this as the formula:

 

Case(Field A="Problem"; TextColor ( Field A ; RGB ( 255 ; 0 ; 0 )); TextColor ( Field A ; RGB ( 0 ; 0 ; 0 )))

 

That formula assumes that the DEFAULT color for the text field is black, by the way. So if the value is changed back from "Problem" to some other value, the text color will revert to black.

Link to comment
Share on other sites

Hey All,

Can think today so hope you can all help: I want to create an If statement that is saying If field A is marked as problem, then turn field A the color red.

Well, sfiore, there's rather a lot you aren't telling us. For instance, you haven't mentioned what color you want field A to be if it is not marked as a problem, nor whether it should stay red indefinitely once marked as a problem, or revert back (?) if no longer marked as a problem.

 

Now the marked area "Problem" is a list value..

It's also not especiallky clear what you mean by this. Marked area? The marked area is a list value? At a wild guess, perhaps you mean that you have a value list attached to field A and "Problem" is one of the values on the list?

 

Based on my collection of guesses, one way you might approach it would be to go into the auto-entry options for field A and define it as an auto-etner calculation (disable the option labeled "do not replace existing value of field...") with a formula such as:

 

TextColor(field A; If(field A = "Problem"; 16711680; 0))

 

This will cause the text in field A to turn red when the value Problem (on its own) is selected in field A, but otherwise the text will be black. However while this will work with drop-down lists and pop-up menus, the colored text will not be displayed if the field is formatted to use check boxes or radio buttons (both of which over-ride character level formatting with the default field text style).

 

If this is not what you had in mind, then if you're able to clarify the question, perhaps someone on the forum will be able to suggest a more apt alternative.

Link to comment
Share on other sites

Hope this helps

 

Field A – My Text

Field B- List with several values one of them being ‘Problem’

 

When I select the value from Field B and choose “problem’ I want ‘Field A – My Text’ to become Red. The initial color of Field A is black and will remain black unless the value ‘Problem’ has been selected from Field B. I would like the Field A to revert back to black if Field B has any other value.

Link to comment
Share on other sites

Hope this helps

 

Field A – My Text

Field B- List with several values one of them being ‘Problem’

 

When I select the value from Field B and choose “problem’ I want ‘Field A – My Text’ to become Red. The initial color of Field A is black and will remain black unless the value ‘Problem’ has been selected from Field B. I would like the Field A to revert back to black if Field B has any other value.

Okay, well in that case, the same setup I described above but with the auto-entry calc formula for field A being:

 

TextColor(field A; If(field B = "Problem"; 16711680; 0))

 

That will do it. smiley_cool

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use