October 28, 200223 yr I've found some solutions in FMForums for this, but none of them solved my request .... 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.
October 28, 200223 yr 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))
October 28, 200223 yr 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. Apologies to the more aesthetically refined members of this forum - but I guess a color demo should be - well ... colourful!!! BackgroundSelect.zip
October 28, 200223 yr 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?!?
October 29, 200223 yr 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.
October 29, 200223 yr Author 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 * * *
Create an account or sign in to comment