2 Replies Latest reply on Sep 24, 2012 11:08 AM by davidanders

    Alpha Five style browse



      Alpha Five style browse


           I am looking at possibly changing over to FMP from Alpha Five V11.  FMP has several key features that I really like. 

           Just so you know where I am starting from...I am a strength coach by trade and have no formal background in programming. I have tinkered with A5 since v8 however.

           I am on week 2 of my FMP trial and have a question.  Alpha five uses a browse which is similar to FMP portals in that is shows a list of related records. With the browse I can easily do a few things that I am struggling to figure out with FMP.

           1) "Record lists"-For example, I would have a contacts form based on a single table.  I could put a browse on a form that would show all of the records (i.e. contacts) in the table. Selecting a record from the browse would then populate the form fields with that records info (for instance: name and address info.)  I cannot seem to make this work in FMP. I can get a list of records using a portal, but cannot get the portal record selection to display in the form fields.

           2)  Related browses-For example, I could have two related tables...lets say "contacts" and "phone_numbers."  I could put 1 browse on a form that would list all of the contacts in the contact table. I could put a second browse on a form that would list all of the phone numbers for the current contact.  Selecting a different contact from the contact browse would populate the phone number browse with that select contacts phone numbers.  The browses were related based off of the relationship establised "behind" the sceens. 

           I am sure these things are easy to do and I am simply missing them in the help files. Any suggestions/guidance would be greatly appreciated.

           Thanks in advance...and I hope my questions are not confusing.




        • 1. Re: Alpha Five style browse

               1) this can be done on a single layout where the portal is a "click list" of items or you can use two layouts where one layout is a list view and the second is a form view. In this second, simpler to set up scenario, clicking a button in the list view layout simply changes to a layout designed for form view but based on the same table.

               Using the portal, you have several slightly different options you can use. You can format the fields in the portal row as a button that performs a script for any of these options, it's what happens in the script assigned to that button that can differ as can the design details of your layout.

               You can set up a self join relationship like this:

               Contacts::AnyField X Contacts 2::AnyField

               Where Contacts 2 is a second occurrence of Contacts so that you have joined a table to itself. By using the cartesian join operator (x) you can literally select any field in the table to serve as the match fields in this relationship and get the same result, a list of all records in the table for your portal to display.

               Option 1. Set up a form view layout with the desired fields from Contacts and a portal to Contacts 2 where the fields in the portal row are specified in Button Setup... to perform this script:

               Go To Related Record [Show only related records; From table: Contacts 2 ; Using layout: <Current Layout> ]

               Option 2. Define a field with global storage named "gSelectedContactID". I will assume that you have an auto-entered serial number field named: __pkContactID to uniquely identify each contact record.

               Add yet another self join relationship:

               Contacts::gSelectedContactID = SelectedContact::__pkContactID

               Then your script becomes:

               Set Field [Contacts::gSelectedContactID ; Contacts 2::__pkContactID ]
               Commit Record

               2) this is sometimes called "Master - Detail" portals where you click a record in the Master Portal and the set of related records for the record clicked appear in the "detail" portal. Take a second look at Option 2 above. If you use this relationship:

               Contacts::gSelectedContact = SelectedPhoneNumbers::_fkContactID


               Set Field [Contacts::gSelectedContactID ; Contacts 2::__pkContactID ]
               Commit Record

               would cause a Portal to SelectedPhoneNumbers to update to list all phone number records for the contact clicked in the portal to Contacts 2.

          • 2. Re: Alpha Five style browse

                 A self join relationship based on a TO (table occurance) would do what you wish.

                 In the portal, highlight a field (first name or whatever) and in button setup, go to related record will show that contact's info in the form.

            The Self-Join Relationship: What it is and some examples of how to use it
            Answer ID: 9610Last Updated: Sep 20, 2011