jediwizzo Posted November 2, 2005 Posted November 2, 2005 Well hello to all. I have been building my first DB in Filemaker and ever evolving it since August. Let me say I am incredibly impressed with this DB and will be building many more DBs to come. So here is the thing, I have a drop down list for project status, I would like to write a script that when say shipped is selected the entire line gets highlighted. Curently we have the Client, Date, Type, and Priority, along with the Status in the list view. So can anyone give me a hand?
mr_vodka Posted November 2, 2005 Posted November 2, 2005 You dont have to do this with a script. Make a calculation container field that displays one image with a background color if your calc result is true. Basically you will need 3 fields to do this. One will be a global container field that stores the highlight image. The second will be a global text field which value will be set by the pulldown menu. The last will be the continer calc field. The calc should be Case (gPulldown = status; gHighlightImage) Put this cal field in the background of your list.
LaRetta Posted November 2, 2005 Posted November 2, 2005 Global text field can be replaced with your Project Status field, if I understood correctly. I see no purpose for it in this example (although I use globals with pop-ups frequently as well). The container calculation would test the Project Status field, ie: Case(ProjectStatus = "Shipped" ; gHighlight). You would need a global if you want the pop-up in the header but User selection on the field will more likely take place in the row itself. Turn off entry into calculation in Field Behavior and move it behind your fields after your alignment is right (Arrange > Send To Back). Your fields will need to be set to transparent fill (and usually transparent line) also. LaRetta
jediwizzo Posted November 2, 2005 Author Posted November 2, 2005 Thanks guys. Now for a dumb question would my script look just like this or is there more I am missing? Case(ProjectStatus = "Shipped" I love these forums you all are amazing
LaRetta Posted November 2, 2005 Posted November 2, 2005 You don't need a script at all. Calculation will handle it. Add a final ) on your calc example. If you get stuck on pasting a colored rectangle into the global container, it must be pasted in during Browse mode. Then you can remove that global container - it won't be necessary to display anywhere.
jediwizzo Posted November 2, 2005 Author Posted November 2, 2005 (edited) Okay i think i finally worked through my bad brain cables. I now understand the "Case" but am not sure were to make a custom "Case" I think my blockade is now how to get the calculation to see the "Shipped" from the drop-down. Edited November 2, 2005 by Guest
LaRetta Posted November 3, 2005 Posted November 3, 2005 You're almost there, jediwizzo. I'm unsure what you mean by 'custom case'. The calculation *sees* the field change to Shipped because you told it to watch the field and 'if Project Status = "Shipped", act as you've told it, ie, grab the color from gHighlight and display it. It watches the Project Status field because the calculation is unstored so it's hypervigilent. No script - just calculation will do it for you. Here is the process step by step: 1) Open File > Define Database > Fields tab 2) Create field name gHighlight, Type = CONTAINER. Create. 3) Select Options (on that field) and go to Storage tab. 4) Check 'Use Global Storage' 5) Type new name called cHighlight, Type = Calculation. Create. 6) In calc box, type: Case(ProjectStatus = "Shipped" ; gHighlight) 7) Below, change calculation result to CONTAINER. 8) Exit field definitions 9) Go to your list layout and enter Layout Mode. 10) Place gHighlight (the global container) on a layout. 11) Using the layout tools (second row far-left box), click and draw a small rectangle. 12) Using Status area, find the paint can. Right below that, click to bring up color options. Color (fill) your rectangle with the color you wish when Project Status is Shipped. 13) Below paint can is what looks like pick ax. Click center grid box (which controls the line pattern). Click the top left box in that popup. That makes the line transparent. 14) Select the rectangle and CTRL-C to copy it. 15) Switch to Browse mode. 16) Click into your gHighlight field and CTRL-V to paste your color into it. Don't worry if it doesn't fill the box; we'll fix that later. 17) Go back into Layout Mode and double-click your gHighlight field to bring up Specify Field. 18) Change it to your cHighlight field and say OK 19) Select your 'now' cHighlight field, right-click and select Graphic format. Change it to 'Reduce and Enlarge' and uncheck 'Maintain proportions. This will make the color totally fill the field in all directions. And it will expand or reduce to always fill the field even if you resize cHighlight. 20) While you are there, go to Field Behavior and unclick 'Allow field to be entered in Browse and Find modes' 21) Place cHighlight on your row. Resize to fill the row. 22) Place your fields (including Project Status popup) on top of the highlight. When you change the Project Status to Shipping, the CALCULATION will fire ... and grab the color from the global container and the calculation will turn color; thus your ROW will turn color. If you follow this step by step, you should have that row highlighting for you! If you get stuck, we're right here to help. LaRetta
mr_vodka Posted November 3, 2005 Posted November 3, 2005 :goodpost: What a thorough posting Laretta. That musta taken you a while ;)
LaRetta Posted November 3, 2005 Posted November 3, 2005 Hi John, Actually I type 110 wpm so it took very little time (and I have the process memorized). But even if it HAD taken 'quite a bit of time,' it might save jediwizzo decipher and confusion time. I would have posted it regardless. LaRetta
jediwizzo Posted November 3, 2005 Author Posted November 3, 2005 You guys are really cool, nothing beats the geek world....
maulanday Posted December 5, 2005 Posted December 5, 2005 Hi, I followed your instructions. However, mine is somewhat different. I have a value list for my field. This is my value list. It's a drop down box. Blue White Green Orange Red I want to change the background color of that field to correspond to the value list. For example, if they scroll down to blue, then the background color will change to blue. Thanks, maulanday
LaRetta Posted December 5, 2005 Posted December 5, 2005 Hi maulanday, Changing the background to correspond with the entry in a field doesn't make much sense to me but I'm confident you have your reasons. Here are the changes you will need to make: The gHighlight (global container) will need to be changed to 5 repititions (you will find that in the Options button for the field and in Storage Options. Then place gHighlight on a layout, and right-click it to display Field Format. Below, change the repetitions to show 1 - 5. Paste each color (one in each repitition). If you paste the colors in the same order as you've listed in your post, your container calculation would become: Case( yourField = "Blue" ; gHighlight ; yourField = "White" ; gHighlight[2] ; yourField = "Green" ; gHighlight[3] ; yourField = "Orange" ; gHighlight[4] ; yourField = "Red" ; gHighlight[5] ) Keep in mind that this will NOT change the colors of the popup. FM will always display your popup in white. But once they've made their selection (and exited the field), the background will change color. LaRetta :wink2:
maulanday Posted December 5, 2005 Posted December 5, 2005 I'm sorry. I must be really slow. I have only been using FileMaker for 2 months. So my cHighlight field won't let me do a drop down box.
maulanday Posted December 5, 2005 Posted December 5, 2005 YOU ROCK!!! I finally figured it out. Thank you soo much! :yay:
Inky Phil Posted December 6, 2005 Posted December 6, 2005 LaRettas post should be in tips and tricks! I know that this is a very basic procedure and I have fully understood the theory of it for quite some time. I never put it into practice because there was always one step or another that I faltered at (eg how do I fill the container field?, how big does the graphic have to be? etc) and so I have never used it. Now thanks to Laretta's detailed steps all my questions are answered. Thank you very much!! Regards Phil
Recommended Posts
This topic is 6930 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 accountSign in
Already have an account? Sign in here.
Sign In Now