Jump to content

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

Recommended Posts

Posted

I've found some solutions in FMForums for this, but none of them solved my request frown.gif ....

In a listview I want to change the record background to a red color, but only when "STOP" in a text field is selected.

I'm sure it must be something with a global field and a calculation. crazy.gif

Posted

The popular technique is to create a global container field "gColours" to hold several coloured rectangles. Then you create a calculated container field "cBkgndColour" with a formula like this:

Case(logicaltest1, GetRepetition(gColours,1),

logicaltest2, GetRepetition(gColours,2),

logicaltest3, GetRepetition(gColours,3),

logicaltest4, GetRepetition(gColours,4))

Posted

You'll find the basic technique shown in bold technicolor in the attached demo file.

It's a blindingly bright file, so don't gaze at it for too long lest your eyesight wain or waver. smile.gif

Apologies to the more aesthetically refined members of this forum - but I guess a color demo should be - well ... colourful!!! wink.gif

BackgroundSelect.zip

Posted

This is very helpful in understanding global containers (particularly using validation calcs) and also utilizing the Get Repetition on Repeating fields. So, since it's a repeating field, you only need to attach the script to Rep1? Also, then, to paste colors in all 5 Repetitions, I just need to make sure it's set to 'show 5 reps' and 'allow entry into field when pasting from browse?' I love this stuff!

HEY, how did you get SCRIPTS on the FM bar to say NIGHTWING?!?

laugh.gif

Posted

There are five scripts in the demo, one for each repetition of the container field. And yes, the colors have to be pasted separately into each of the repetitions in browse mode.

Changing the name of the 'Scripts' menu is achievable with the Developer tool which comes with FileMaker Developer. wink.gif

Posted

Thanks a lot everybody! It works great and I have some new ideas about using colorfields in layouts, like a 'red' sign to stop or a 'green' sign to release a record.

Karel

* * * A thankful heart is a happy heart * * *

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