12 Replies Latest reply on Jun 4, 2015 3:56 AM by rrrichie

    Whats the best way to search for and choose a contact within a layout?

    docpanderson

      You guys have been a great help so far.  Thanks.  I still need to be able to search for and input to whom I am referring this patient to on the right hand side of the referral form.  I have a DB set aside just for providers and also have providers mixed in with my list of practice contacts using the contacts quick start db and am open to doing it either way but prefer to keep the db of providers separate.  Any suggestions about how to go about this?

      Here's what I would like to do...

      Write a script that when the referral type says Massage therapy it would immediately open up my list of massage therapists

      if the referral type says Physical therapy it would likewise open up a list of physical therapists.

      I need to be able to add a therapist on the fly in case they are going to someone not on my list.  Once I pick the therapist I want that therapists contact info to go into the white box below, and the new therapist updated to the list of therapists.

       

      Am I asking for the moon?  I still am too new to writing scripts to figure out the steps in how to do this so if anyone could point to a decent reference regarding how to write and manipulate scripts I would appreciate it.

       

       

      5-26.JPG

      As a side note, it would be nice to automate the process of when the referral type says physical therapy it would automatically open the physical therapy tab.

      Peter

        • 1. Re: Whats the best way to search for and choose a contact within a layout?
          mikebeargie

          So you could potentially use an OnObjectModify script trigger on that drop down that does the following:

          Set Variable [ $type ; referral::referralType ]

          New Window [ "Select Therapist" ]
          Enter find mode (uncheck pause)

          Go To Layout [therapists selection list]

          Set Field [ therapists::type ; $type ]

          Perform Find

          Sort Records

          scroll window [home]

           

          As a trigger, anytime that someone changes the value using that dropdown, it would open a new window, go to a list of therapists, perform the find for the type of therapist that was selected, sort and go to the top of the list.

           

          Then, you need a button next to each therapist on the list that performs the following:

          Set Variable [ $therapist ; therapists::primaryKey ]

          Close Window [ "Select Therapist" ]

          Set Field [ referral::therapistForeignKey ; $therapist ]

          Commit Record [ no dialog ]

          Your referral record could then pull the related data directly from the therapist's table.

          • 2. Re: Whats the best way to search for and choose a contact within a layout?
            docpanderson

            I'll give that a try and get back to you.

            • 3. Re: Whats the best way to search for and choose a contact within a layout?
              siplus

              The best way to search for (and choose) is to never forget what your goal is.

               

              You have a patient, and you have a referral type. Your goal is (or should be) "the best possible for my patient".

               

              Which in turn means that you must have a sort order for the referral names, one different from alphabetic. You need a name portal filtered by referral type and sorted by "stars" desc, a rating you must care about and modify by getting input from your own patients after their interaction with the referred. You print the first 4 names on your list and the patient will try to get an appointment with them. Or you do it for them.

               

              When the patient gives you a name of a referral you don't have in your list, ask why. Try to find out more. Establish contact, but do defend your favorites, professionists you trust and your other patients are fond of, by explaining to the patient what makes them worthwhile being considered.

               

              The "how to" and "where to click" are the last layers you should consider

              • 4. Re: Whats the best way to search for and choose a contact within a layout?

                Your request is for a popup list of referals to select from based on the value entered in another field.

                 

                Attached is a file with two tables, the simplest method of all:

                Report - I chose this name but it can be whatever is appropriate. This is the form you fill in for the patient

                Provider - a list of make believe doctors with my non-medical type of referals.

                 

                Open the two as a table and you can see what I entered and enter your own data for testing. The paatient is just a number.

                 

                Attached is a sample file that shows one method of using a conditional value list that depends upon the values entered in another field. Also note that I have entered multiple referal types for some of the providers and each is selected accordingly.

                 

                Study how the value lists were assigned. One derives its values from the provider records and the other is the conditional value list that depends upon the linking field.

                 

                If you wish to go to the tab, name your tabs the same as the referal type. Then add a trigger (on save) to the popup menu with a script that says Go to Tab Object (referal type)

                 

                Simple, clean, done.

                 

                So, I didn't notice that part of the question. I could add it in if the instructions aren't clear.

                 

                Actually I did and have replaced the file.

                 

                It took less than 2 minutes to add the tabs, name them and attach the one line script to the popup.

                 

                I just added a slight touchup so the providers name is removed if you select another referal type.

                • 5. Re: Whats the best way to search for and choose a contact within a layout?

                  Kinda complex. Check the file I uploaded for a simple technique.

                  • 6. Re: Whats the best way to search for and choose a contact within a layout?
                    docpanderson

                    I think your assessment of what I am looking in for is pretty close.  There was no file attached though.  Can you email it to me at docpanderson@gmail.com?

                    • 7. Re: Whats the best way to search for and choose a contact within a layout?
                      mark_baum

                      Hi Peter, Jack's suggestion of a single database file with two tables also makes sense to me as a place to start. He did provide an attachment -- do you see it at the bottom left of his posting?

                       

                      In your original posting, you wrote "I have a DB set aside just for providers and also have providers mixed in with my list of practice contacts using the contacts quick start db and am open to doing it either way but prefer to keep the db of providers separate."


                      It sounds like you just want to keep the providers in a separate table, not in a separate database file. Is that correct?

                       

                      After you get a better grasp of the options for filtering relationships, you may decide that you can place patients and providers in the same Contacts table. Or there may continue to be very good reasons to keep them separate -- that's a decision you'll want to return to as you continue to develop your solution.

                       

                      Cheers -- Mark

                      • 8. Re: Whats the best way to search for and choose a contact within a layout?
                        docpanderson

                        Mark,

                        I was open to doing it either way, but it seems to make more sense to me to just have a separate table and keep everything in one database.  I'm still developing, and learning as I go so I appreciate you pointing out alteranatives.

                        Peter

                        • 9. Re: Whats the best way to search for and choose a contact within a layout?

                          I uploaded a db that did what you asked an emailed you a copy when you asked but you have not responded? Any problem with the file?

                          • 10. Re: Whats the best way to search for and choose a contact within a layout?
                            docpanderson

                            Jack,

                            Yeah so I looked at what you had sent me, just been backed up with other work things.  I didn't really understand the purpose of the tab control at the bottom of what you sent me.  Here is a snip from my database.  Maybe this will make it a little more clear what I am trying to do.

                             

                            Send to Jack.JPG

                            The Referral To box says <Table Missing> right now.  What I am trying to do is set it up so that when the referral type I wish to make is to physical therapy, if I choose that setting on the drop down, it will take me to a list of physical therapists based upon my Providers Table.  The Providers table looks like this:

                             

                            Send to Jack 2.JPG

                            I want it to show all of the providers in my Provider table that have a Provider type of Physical Therapy from the drop down on field #2.  Likewise if referring to a massage therapist it will do the same. However, the Referral form needs to provide the patient with the providers address and at least a phone number.  Hope this clarifies what I'm trying to do.  I appreciate your feedback.

                            Peter

                            • 11. Re: Whats the best way to search for and choose a contact within a layout?
                              siplus

                              I guess what you are looking for is something like this:

                              • 12. Re: Whats the best way to search for and choose a contact within a layout?
                                rrrichie

                                Hi Peter,

                                Welcome to the FileMaker world... The best way to write scripts is to look at other examples, try to understand them and then try to write it yourself.  Just create new databases with minimal tables and layouts and experiment.

                                 

                                It seems like you are looking for what has been named Virtual Lists in the FM scene... Always handy in any solution.  In general it works like this... You add a table with about a 1000 rows, the data displayed in the rows is pulled from a global variable.  Each row always starts with the ID of the item you want to select.  You can fill the global in several ways.  Using ExecuteSQL is a pretty convenient one.

                                 

                                One nice example of it is built in this demo of selector connector file.  Click the Orders and then on the pencil to get the list I mean.  You can determine with a SQL query which fields you want to show.

                                 

                                https://www.geistinteractive.com/2014/11/21/filemaker-selector-connector-video/

                                 

                                Here is a similar implementation.  The virtual list in on the left.  You could put that in a popup window so a user can select or type to find the referral to choose.

                                 

                                http://www.modularfilemaker.org/module/masterdetail-2-0/

                                 

                                Happy Coding!