Adding a Splash of Color to GoldMine
A client sent in a question today and I may have gotten a little carried away with the answer. Maybe the information will prove useful for others!
Question 1:
Is it possible to setup a special rule where certain records can pull up different Field views (from the fields screen designer we can setup different views). For example, I had mentioned before we might be using the Merge field to contain a specific record type. Depending on that record type it would pull up a different field view.
Answer:
It IS possible, but the feature doesn’t work well. It can be found under File|Configure|Record Types Administration Center. There you define rules and record types and different field layouts, coloration, etc. In reality, however, it’s just plain buggy. I would stay away from it until version 7.0.4 (which supposedly should provide much-needed stability to this feature.)
Until then, however, you CAN change field colors and such based on rules by placing expressions in the color tab of the fields’ properties. Both the label and data colors can be customized.
iif(left(Contact1->Key3,1)="A", 32768, iif(left(Contact1->Key3,1)="B", 16776960, iif(left(Contact1->Key3,1)="C", 3145645, iif(left(Contact1->Key3,1)="D", 42495, iif(left(Contact1->Key3,1)="F", 255, 0)))))
That’s an extreme example of a coloration expression I use in my own GoldMine. It causes the label of my ‘Rating’ field (key3) to be one of five colors depending on the contents of the field being A, B, C, D or F.
Similarly, I have a field that shows me how much time a given contact record has remaining with me. If the number is positive, the field is green, if the number is negative (or zero) the number is red. It’s a much simpler expression:
iif(contact2->utimeleft<=0,255,32768)
The numbers represent colors. I have a a pretty long list of color codes listed below (I’m not sure who posted it in the FrontRange forum, but I socked it away for future reference months ago):
————————————————–
AliceBlue 16775408
AntiqueWhite 14150650
Aqua 16776960
Aquamarine 13959039
Azure 16777200
Beige 14480885
Bisque 12903679
Black 0
BlanchedAlmond 13495295
Blue 16711680
BlueViolet 14822282
Brown 2763429
BurlyWood 8894686
CadetBlue 10526303
Chartreuse 65407
Chocolate 1993170
Coral 5275647
CornflowerBlue 15570276
Cornsilk 14481663
Crimson 3937500
Cyan 16776960
DarkBlue 9109504
DarkCyan 9145088
DarkGoldenrod 755384
DarkGray 11119017
DarkGreen 25600
DarkKhaki 7059389
DarkMagenta 9109643
DarkOliveGreen 3107669
DarkOrange 36095
DarkOrchid 13382297
DarkRed 139
DarkSalmon 8034025
DarkSeaGreen 9419919
DarkSlateBlue 9125192
DarkSlateGray 5197615
DarkTurquoise 13749760
DarkViolet 13828244
DeepPink 9639167
DeepSkyBlue 16760576
DimGray 6908265
DodgerBlue 16748574
FireBrick 2237106
FloralWhite 15792895
ForestGreen 2263842
Fuchsia 16711935
Gainsboro 14474460
GhostWhite 16775416
Gold 55295
Goldenrod 2139610
Gray 8421504
Green 32768
GreenYellow 3145645
Honeydew 15794160
HotPink 11823615
IndianRed 6053069
Indigo 8519755
Ivory 15794175
Khaki 9234160
Lavender 16443110
LavenderBlush 16118015
LawnGreen 64636
LemonChiffon 13499135
LightBlue 15128749
LightCoral 8421616
LightCyan 16777184
LightGoldenrodYellow 13826810
LightGreen 9498256
LightGrey 13882323
LightPink 12695295
LightSalmon 8036607
LightSeaGreen 11186720
LightSkyBlue 16436871
LightSlateGray 10061943
LightSteelBlue 14599344
LightYellow 14745599
Lime 65280
LimeGreen 3329330
Linen 15134970
Magenta 16711935
Maroon 128
MediumAquamarine 11193702
MediumBlue 13434880
MediumOrchid 13850042
MediumPurple 14381203
MediumSeaGreen 7451452
MediumSlateBlue 15624315
MediumSpringGreen 10156544
MediumTurquoise 13422920
MediumVioletRed 8721863
MidnightBlue 7346457
MintCream 16449525
MistyRose 14804223
Moccasin 11920639
NavajoWhite 11394815
Navy 8388608
OldLace 15136253
Olive 32896
OliveDrab 2330219
Orange 42495
OrangeRed 17919
Orchid 14053594
PaleGoldenrod 11200750
PaleGreen 10025880
PaleTurquoise 15658671
PaleVioletRed 9662683
PapayaWhip 14020607
PeachPuff 12180223
Peru 4163021
Pink 13353215
Plum 14524637
PowderBlue 15130800
Purple 8388736
Red 255
RosyBrown 9408444
RoyalBlue 14772545
SaddleBrown 1262987
Salmon 7504122
SandyBrown 6333684
SeaGreen 5737262
Seashell 15660543
Sienna 2970272
Silver 12632256
SkyBlue 15453831
SlateBlue 13458026
SlateGray 9470064
Snow 16448255
SpringGreen 8388352
SteelBlue 11829830
Tan 9221330
Teal 8421376
Thistle 14204888
Tomato 4678655
Turquoise 13688896
Violet 15631086
Wheat 11788021
White 16777215
WhiteSmoke 16119285
Yellow 65535
YellowGreen 3329434
————————————————–
Finally, here’s one off-beat (but powerful) example:
IIF("AA" $ upper(contact1->key5).or."BB" $ upper(contact1->key5),-2,1)
It hides the field label (color -2) if it’s not AA or BB. This can be very handy for setting up fluid layouts that change based on the record type without depending on the buggy Record Type feature.
Have you got your own handy expressions? Feel free to add them in the comments area or in the forum!
lisaharris
Here’s one of my favorites:
iif(((contact2->umnofax)=”No”),255,0)
It’s on the fax field. So if my user defined field for “OK to Fax” is set to No, the fax number will turn red.
BTW, I was the one that posted the list of colors. Be wary of those that start with “light”. If you want to preview a color (because just what IS PapayaWhip, anyway?) just go to the layout of a field, click the Color tab, and type a number in the expression box. You’ll see a preview of the color right above the expression box. Way cool.