4 Replies Latest reply on Feb 12, 2013 4:55 PM by beano129

    Tab scripts / Stringing Strips Together



      Tab scripts / Stringing Strips Together


           Hi all, 

           I've created a contacts database and I want to make it easy to navigate. 

           I've currently got 400 records in and they are currently sorted in Alphabetical Order by Company name. 

           I have then created 7 tabs which are the states of Australia which I also have a field for. 

           What I want is for a script to run that means when an operator clicks on a STATE Tab, the script runs to either min any record that's NOT that particular state OR SHOW ONLY the particualr records of that state (I know effectively this is the same argument but while i'm still quite new, i'm not sure if one method is favoured over the other) 

           I have made scrips that do this but I can't seem to assign differnt scripts to the different tabs - it just seems to run whichever script i've designated to all of the tabs. 

           Then Again......

           Is there a way of stringing scripts together like IF functions in Excel? 

           This might be a way of me solving the prblem 

           So the idea here being 

           opon clicking on a tab a script runs to:-

           Show All Records - show only records from (define state / state neme on tab)

           I hope this doen't lose anyone - i did want to put this on 2 posts but felt i needed the background to explain properly. 


           Many Thanks 



        • 1. Re: Tab scripts / Stringing Strips Together


               What you're wanting is for the tab labels to act like buttons - so I suggest that you'll have to set up similar layouts - one each for the seven states - with a design that mimics the tab layout, so that the tab labels are indeed buttons, with scripts which then take you to the desired state layout, does the find/sort etc.. you can also set the non-active buttons to 'grey out' on the layouts that aren't in focus

               So if you click on WA, all the other buttons grey out, but are still clickable, and you are presented with only WA data..

               You'll probably want an eighth 'home' layout that has all seven states with equal font weight and color on its buttons, as a base layout when you open the file.


          • 2. Re: Tab scripts / Stringing Strips Together

                 and yes nested IF statements are also possible and practical - also have a look at other script functions like CASE which may be useful in a Go To Layout (layout name by calculation) for branching users to specific layouts:


                 Let ([ac = Get ( AccountName )];
                 (Case (
                 ac  = "Jo"  or ac = "Richard" or ac  = "Amy" ; "prospect";
                 ac  = "Renae" ; "comms" ;
                 ac  = "Tara"  or ac  = "Leigh" or ac = "Andrew" or ac  = "Intern" ; "basic" ;
                 ac  = "Administrator"; "special" ;
                 ac  = "Agatha" ; "FOH" ;
                 ac  = "Tim" ; "projects" ;

                 so if Agatha logs on, the script sends her to the "FOH" layout


            • 3. Re: Tab scripts / Stringing Strips Together


                   I have a way to do this.pls follow this

                   You have a table having 400 recordss with "state" is a field  in this table.

                   So make a layout (based on global)having 8 tab in it.One is for "show All" and rest 7  are for all 7 states.

                   Craete a global field like g_State in global table(the layout based upon)

                   Make two relationship among the GLOBAL and your table(let it be CONTACT)


                   constant1=constant1(specially it is used to show all contact records menas 400 records)


                   g_State=State(it will fetch only related state's record depend upon the g_State value.)

                   IN "show All" tab put a portal based on the constant relationship to show all record and it suold be the default tab for that layout

                    and for other 7 tab put the other portal based on the  g_State relationship.

                   Make a script like this(FilterByState)

                   set field g_State=clicked state value

                   Commit record reguest.

                   Add this script e,g FilterByState to all the tab on click object trigger except the Show all tab.

                   Hope you'll get your answer.





              • 4. Re: Tab scripts / Stringing Strips Together

                     Hi all, 

                     Sorry this took a ferw days to get back to you all but I very much appreicate your correspondants! 

                     At the moment, i'm favouring the buttons set-up only because i'm trying to develop a customised solution for someone and he seems to favour buttons. This also appears to be the easier of the methods while i'm still getting used to the full extent of what filemaker can do. 

                     I'm actually signing up to attend the semiar that coming up in March which i'm hoping to get some good insight to but certainly for the time being I am going to move forward with the buttons suggestion however I think that I will need to start creating some relationships with other databases. 

                     If that's the case i'll start some new posts. 

                     Thanks again for all your help chaps! 

                     Very much appreciated :-)