6 Replies Latest reply on Aug 5, 2010 9:54 AM by yoelcita

    OnRecordLoad script and invisible tabs

    yoelcita

      Title

      OnRecordLoad script and invisible tabs

      Post

      I have three invisible tabs in my layout that I want to display according to the value of a field (either a drop-down or radio button field -- with three available values).  I have only been able to get Go to Object to work as a script triggered by a field modification/exit/etc.  It works, but seems to function no differently than a regular visible tab.  When the user views another record, the same tab that was displayed in the previous record is the one that shows.  How can I get the field's already-selected value in a specific record to determine which tab shows, with no user action other than loading the record?  Any help or suggestions are greatly appreciated... I don't know if I made any sense!

      I'm using FileMaker Pro 10 and have just basic experience.

        • 1. Re: OnRecordLoad script and invisible tabs
          philmodjunk

          You'll need another script trigger that updates the tab control when the user moves to a different record and if the selected value is to apply to all records, it should be a field with global storage selected so that you get the same value no matter which record is current.

          OnRecordLoad with the global field should do the trick.

           

          • 2. Re: OnRecordLoad script and invisible tabs
            yoelcita

            I thought so... But I don't want the value selection to apply to all records.  It's a sponsor database, where most sponsors will be classified as "sole  sponsor" while a smaller number will be classified as "primary sponsor"  or "secondary sponsor".  Some fields are only applicable to one of  the latter two profiles, so my goal is to make them hidden in the  appropriate invisible tab unless their classification is changed.  Then  when the user enters an established record, it automatically displays the correct tab, no matter what tab the previously viewed record had visible.

            I have three basic Go to Object scripts set up for each of the three tabs, but I'm pretty much lost after that... or maybe there's another way to do it?  How would I define the script parameters for the OnRecordLoad?

            Thanks for your help!!

            • 3. Re: OnRecordLoad script and invisible tabs
              philmodjunk

              I'm assuming that you see one record at a time. Is this the case or do you have a list view of the data set up so that more than one tab control is visible at one time?

              You ONRecordLoad script should call the same script you are using to select a tab when you change the field that controls which should be selected.

              • 4. Re: OnRecordLoad script and invisible tabs
                yoelcita

                Yes, viewing only one record at a time.  However I don't know how to get the script to work right.  If I had a single drop-down or radio button field with three options, how do I get a particular option to navigate to its tab?  I imagine it's very straight-forward and I just don't know what I'm doing, so I apologize!!  The only thing I've been able to do on my own so far is create a simple Go to Object script triggered by a field modifcation.  I split a radio button field into three objects, and had them each call a different Go to Object script for the three tabs.  That works, but functionally that seems no different than a visible tab.

                • 5. Re: OnRecordLoad script and invisible tabs
                  philmodjunk

                  Your script can then work like this:

                  If [table::Tabselector = "Tab one"]
                     Go To Object ["First Hidden tab"]
                  Else If [table::Tabselector = "Tab two"]
                     Go To Object ["Second Hidden tab"]
                  Else
                     Go To Object ["Third hidden tab"]
                  End IF

                  If you name the tabs with object names exactly the same as the values in your value list, it's even simpler:

                  Go To Object [Table::TabSelector]

                  This script can be used with OnObjectModify or OnObjectExit to select a tab when a value is selected from the list and can be triggered with OnRecordLoad to select the correct tab when the user navigates to a new record.

                  • 6. Re: OnRecordLoad script and invisible tabs
                    yoelcita

                    Works perfect!  I'm sure I would have never gotten it right.  Thank you!!!!!!!