4 Replies Latest reply on Apr 28, 2013 11:26 AM by GrahamDavies

    Go To Related Record in same layout

    GrahamDavies

      Title

      Go To Related Record in same layout

      Post

           Hi - 

           I am more of analyst than a developer - so apologies in advance if this is hugely straightforward - I have however spent several hours yesterday trying to make this work to no avail.

           The first table in a new databse I am creating is called Customers - and has the following fields on it:

              Name_First  (Text input field)

              Name_Last (Text input field)

              Name_Combined (Calculation:  Name_First & " " & Name_Last)

             (...a number of other fields... but these are not required to outline the issue...)

            

           In browse mode I want users to be able to input data - no issue there.  I would hoever like to include a button that does the following:

              When the user depresses or hovers over the button - a drop down list of already created customers to appear (this is why I have the Name_Combined field - I would like the list to be generated from this field)

              If a user scrolls down to one of the existing users and then selects that user - I then want to filemaker to move to that record...

           I have included a sample screenshot.  Lets say the user has entered the details of 3 cutomers (i) John M Doe, (ii) Susan Smith and (iii) Andrew Jones.  Whilst on the John M Doe record if they press the "Go to custmer..." button I would like it to show a dop down list of "John M Doe, Susan Smith and Andrew Jones".  If they choose Susan Smith I want Filemaker to navigate to her record.

           I am sure this should be a piece of cake to do this... I am just not getting how to do it.

           Thanks

           Graham

            

            

            

      Example.png

        • 1. Re: Go To Related Record in same layout
          misham

               Hi Graham
                

               To display the name of already created customers you can create a value list from the table Customers with Name_Combined as field and attach it to some field to show the value.

               Then you can create a relation from Customer to Customer starting from the field in which you are storing the name/id from dropdown to the Name_First/Cust_ID(Primary Key) and use the same relation in the GTRR step.

               You might see the screenshot attached  for the value list creation. You need to create two more fields one to hold customer id(global field, say Nav_CustomerID) and second one(calculated field, say Customer::Nav_Customer) to display the name based on that customer id.

               You need to create a single relationship:

               Source:Customer
               Table:Customer
               Options:
               Customer::Nav_CustomerID = Customer__CustID_CustName::Cust_ID

               You need to use this TO for the GTRR step.

               Or you might look into the example file https://www.dropbox.com/s/kqqnmic1mvt3ui9/Customer.zip?m

                

               Thanks
               Misha Mahto
               Software Developer
               http://mindfiresolutions.com
               FileMaker 11 Certified Developer

                

          • 2. Re: Go To Related Record in same layout
            JimMac

                 Misha answered you question with how to.... but note that you must first have a complete record entered or committed to get a correct combination first and last name.

                 Three things that are difficult about what you asked...

                 1) You want to Navigate from a Date Entry form.  Kinda the cart before the horse.

                 2) You want to select a Customer name from a drop down list, which is ok, until you have 50+ customers.

                 3) You might have typo's, duplicates, or incomplete names and need a few more identifiers to pick and navigate correctly.

                 To select from a long list, without using a Find request, Try......

                 1) Create a new Layout in List format and put your "pick" button in each line..

                 2) Create a self joining Portal to show the list of clients with your "pick" button..

                 But.....

                 Most users will enjoy a Find request better.wink

                 Just like when you call in to a operatot to identify your accounts...  Last name , First name   and for security reasons the last 4 of you SS# and what was your favorite Uncles most favorite Harmonica tune?angel

                 Jim....

                  

                  

            • 3. Re: Go To Related Record in same layout
              GuyStevens

                   The simple answer would be to run a find script on the "OnObjectModify" event as a script trigger;

                   So that when you modify the dropdown (e.g. select a name) your script runs and finds the selected person.

                   Maybe add a "show all records" at the end of your script so you don't get stuck on your 1 fond record.

                   But it's true that going to a list layout is also a good option. There you could even use some subsummary sorting if you want.

                   But it's possible to do this in a very simple manner.

                   If you need any help with this make sure to let us know.

              • 4. Re: Go To Related Record in same layout
                GrahamDavies

                     Thanks all - all the answers make a lot of sense - so much appreciated.  

                     Particularly appreciated the worked example - as it help to pick the various pieces apart - top marks.

                     I totally agree that I should consider a list layout when the number of names becomes large (there are a few different contexts I am planning to apply this on - so where the number of options is small - I like this approach...)

                      

                     Thanks again.  Graham