6 Replies Latest reply on Nov 21, 2009 2:38 AM by Sorbsbuster

    New to FMP - HELP!

    mattb

      Title

      New to FMP - HELP!

      Post

      I am a Visual Foxpro programmer new to FMP.  I need to duplicate something that was easy to achieve in VFP but seemingly

      impossible in FMP.  I've tried a number of different approaches but none do the trick, so I'm now asking for help.

       

      On one layout form, using data from one table, I need to do the following:

       

      1)  On the left side of the layout, I need to create a list that consists of all the records in the table from just one field, as if showing

      one field in table view

       

      2)  On the right side of the layout I need to show 4 fields from just one record in the table, as in form view.

       

      3)  When a particular record from the list on the left is clicked on, it would move the record pointer and change the data in the 4 fields on the right side to correspond with the selected record.

       

      Basically this is a table navigation scheme that would substitute for the same function as the Records tool in the Status Toolbar.  But instead

      having the user click Next or Previous or use the slider, I want them to pick from a list on the left, which would in turn move the record pointer

      and refresh data on the right.

       

      Seems to me this should be doable, but I'm stumped.

       

      In Visual Foxpro, I'm using a List object (which FMP doesn't have) which is stuffed from an array.  Then the navigation is accomplished by

      clicking on an item in the list, which refreshes the data on the right.  

       

      Thanks in advance for any help in reproducing this functionality in FMP!

       

       

       

      Matt Bloomfield

      New FMP User

       

        • 1. Re: New to FMP - HELP!
          philmodjunk
            

          You can do this.

           

          Display your Record list in a Portal. If you set it up right, you can use the X operator in a self join to match all records.

           

          Set your portal field up as a button to perform a script that uses Go To Related record to switch your current record to the selected record. If your script stores the PrimaryKeyField value in a Global field, you can even use conditional formatting to Highlight the clicked portal row.

           

          For more about Go To Related Records, see:

           

          The Complete Go To Related Record

          • 2. Re: New to FMP - HELP!
            mattb
              

            PhilModJunk:

             

            >You can do this.

             

            OK, that's encouraging.

             

            >Display your Record list in a Portal.

             

            How do you do this?  

             

            >If you set it up right, you can use the X operator in a self join to match all records.

             

            I created a self-join in the Relationships window of Manage Databases, but I don't understand what

            you're talking about in referring to the "X operator".  I inserted a portal onto my layout and specified

            the field I wanted from the related table (copy of the same), but it just shows one record, not a list of

            records like I want to have.  I must be missing something obvious.  Can you straighten me out

            on this?  Thanks...

             

             

             

            Matt Bloomfield

              

             



            • 3. Re: New to FMP - HELP!
              philmodjunk
                

              When you drag from Table Occurrence (TO) box to TO box in the relationship graph. The default operator, = , is selected for your relationship. If you double click the line linking your two TO boxes, a dialog pops up where you can specify more relationship details. You can select the cross product operator (X) instead of = here. The cross product operator tells Filemaker "Match any nonblank value". So you can connect any two fields here as long as they're never empty. An auto-entered serial number or a calculation field that returns a constant value like 1 makes a good choice here.

               

              Now that every record in the first TO matches every record in your second TO, you can base your layout on the first TO in Layout Setup... and specify the second TO name when you set up your portal and all the records in the second TO's table will be listed in the portal.

               

              For more about tables and table occurrences, see this thread:

               

              Table vs. Table Occurrence (Tutorial)

              • 4. Re: New to FMP - HELP!
                mattb
                  

                PhilModJunk:
                 

                >When you drag from Table Occurrence (TO) box to TO box in the relationship graph. The default operator, = , is selected for your relationship. If >you double click the line linking your two TO boxes, a dialog pops up where you can specify more relationship details. You can select the cross >product operator (X) instead of = here. The cross product operator tells Filemaker "Match any nonblank value". So you can connect any two >fields here as long as they're never empty. An auto-entered serial number or a calculation field that returns a constant value like 1 makes a >good choice here.

                 

                >Now that every record in the first TO matches every record in your second TO, you can base your layout on the first TO in Layout Setup... and >specify the second TO name when you set up your portal and all the records in the second TO's table will be listed in the portal.

                 

                Perfect, that worked!
                Now to complete the task, you said:
                > Set your portal field up as a button to perform a script that uses Go To Related record to switch your current record to the selected record.
                How does one set up a Portal field "as a button"?  Not obvious to me. 
                I appreciate all your help so far!   Thanks...
                 
                Matt Bloomfield
                 
                 
                 
                • 5. Re: New to FMP - HELP!
                  mattb
                    

                  PhilModJunk:

                   

                  Never mind, I figured that out:  Script Trigger -> On Object Enter.  It works.  Thanks so much for your help!

                   

                   

                   

                  Matt Bloomfield

                  • 6. Re: New to FMP - HELP!
                    Sorbsbuster
                      

                    That's just one way (and not the most common way, I'd suggest).  The more usual way is to right-click on the field and select 'Button Set-up...' and assign the script to the field.  Any object on a layout can be made to function as a button that way.

                     

                    I think your field was in a portal, so in this case it would usually be considered an advantage that assigning a button to a field also makes it non-enterable in browse mode.

                     

                    Alan