11 Replies Latest reply on Feb 20, 2012 7:02 PM by dinora






       Is there a way to have a portal on a layout and as you scroll down through each portal record, a portal next to this one displays information that relates to the portal record highlighted.

      Keep in mind this is information based upon two portals

      So I have a patients table, that has a tab labeled as visits

      Under this tab I am now able to a list of the visits the patient has seen the doctor, and selecting on a specific visit displays on a portal the diagnosis of the patient for that visit. 

      Each visit could be assigned multiple diagnosis. So by selecting a visit I see on the portal

      Diagnosis A

      Diagnosis B

      Diagnosis C

      All of this is working, what I need now is on this same layout as I scroll down through the diagnoses on that visit, to be able to have a portal that tells me details about Diagnosis A. and then if I highligh Diagnoses B I get the portal to update with information relating to Diagnosis B, so on and so forth

      Can you help?



        • 1. Re: Portals

          To highilight different portal records requires clicking on the portal row. This is sometimes called "master-detail" portals where clicking on a button in portal1 triggers a script to update portal 2 to display detail info about the record clicked in the row of the first portal.

          For the sake of this example, I will assume that you have this relationship:


          This isn't necessarily what you have, the details you want to display could be fields in Diagnoses, but the details of how this works very only slightly in that case. What you can do is define a relationship straight from Patients to the table that stores the details you want to display in the "Detail" portal.



          Patients::gSelectedDiagnosisID = DiagnosisDetails::__fk_DiagnosisID


          Patients::gSelectedDiagnosisID X DiagnosisDetails::anyfield

          can be used, this second option requires FileMaker 11 and uses this portal filter: Patients::gSelectedDiagnosis = DiagnosisDetails::__fk_DiagnosisID

          A button in the master portal (shows list of diagnosis records) uses this simple script:

          Set Field [Patients::gSelectedDiagnosisID ; DiagnosisDetails::__fk_DiagnosisID ]
          Commit Record

          With either method, this script will update the detail portal when you click the button in the master portal. You can select all the fields in master portal and use button setup to turn the entire portal row into a large clickable button.

          And conditional formatting can compare the same two fields to specify a fill color to highlight the portal row when they are equal.

          • 2. Re: Portals

            Hi Phil

            Thank you for your email but I am not sure I can get it to work.  First of all I am using FM 10

            So you are corrrect, I have Patients - Visits -Lets not call them Diagnoses but call them symptoms - Symptom Details.

            Patients, Visits, Symptoms, and Symptoms Details. 

            PK Patient relates to FK Patients in the Visit Table.

            Then I have a creation Date for a visit this is inserted automatically when I create a visit record.  But in order to allocate multiple symptoms to one visit.  I had to create a table where Visits and Symptoms relate.  One visit can have multiple symptoms.

            PK Visit relates to FK Visits in the Visits/Symptoms Table

            PK Symptoms relates to FK Symptoms int he Visits/Symptoms Table.

            I did create a global field for date in the Visits/Symptoms table along with a calculation field so that when I go to the Patients layout Under the Visits tab, I can choose from a pop up menu the visit date and displays the symptoms found on that date.

            I am not sure if I did this correctly, but is working, What I need now is to display the details of the symptoms as I scroll through the portal rows.

            The Patients table only relates to the Visits table.

            I hope you can help



            • 3. Re: Portals

              I don't understand how this works for you by specifying a date. Won't that pull up symptoms records for all patients who have a visit record of that date? Why wouldn't you use the Visit ID to pull up all symptoms for that visit?

              From your post, I only see differences in the names of the tables and key fields so the method should work for you.

              • 4. Re: Portals

                Hi Phil,

                I am sorry maybe I am doing this wrong.  Based on what i Have told you so far, I have a global field for the visit date which is located on my patients layout and the way I have this global field only show my the visits for that patient is a result of making this field be a pop up field that looks up the value of the visit date starting from patients.

                This works and I am not sure if is correct or note, meaning from a database developer point of view. Can you comment?

                So now I have this global field that indicates by pop up the visits this patient has had and by choosing a visit I have a portal that comes from  my Joint visits/Symptoms table - Displaying the field FK Symtoms

                My problems starts here,

                I want to be able to scroll through this symptoms by higlighting a portal row and have yet another portal that displays the details of the sympton as I highlight the portal row that has the symptons name

                The portal row with symptoms details will only have one row.

                From your solution I dont understand how to related patients to symptoms -  How is that going to give me the symptoms by visit?


                • 5. Re: Portals

                  This works and I am not sure if is correct or not, meaning from a database developer point of view. Can you comment?

                  Did I suggest this in another forum thread? I did not suggest that in THIS thread. Wink

                  I make way to many suggestions to way too many people to remember this if it is from a different thread. Can you describe how that works in more detail? Just selecting the date alone won't filter your records down to data from a single patient's visit on that date without some other detail involved such as a multi-field relationship that includes another field such as the patient ID or a portal based on patient ID with a portal filter that uses the specified date to filter the records down to just those of a given date. Don't know which you've used here or if you used some other method.

                  • 6. Re: Portals

                    What I meant did not come from you. This is me with my poor skills in development.  I was trying to explain how I got to where I am. 

                    Let me revisit my relations and I will get back to you see if I can explain better what I have


                    • 7. Re: Portals

                      Hi Again,

                      Here is attached is a layout of my relations map - As you will see I have a global date that allows me on the patients table to display only visits that relate from that patient.  This is thanks to a value list that only displays from patients.

                      With the way I currently have the relationships I am able to display in the patients layout the visits for that table and the biomagnetic pairs (Symptoms to make it easier labeled in red on my image) found during that visit .

                      The challenge is now how to display only the details of the symptoms that show up on that visit. I am currently able to have a portal that displays all the symptoms for that I found for the patient regardless of the visit.

                      1.- I need to filter this portal to only show me details of the symptons that I found on that visit for that patient only

                      Example, John Doe visited me on Feb 9 and Feb 13 - On Feb 9 Symptoms are headache, sore throat, on Feb 13 stomach ache only.

                      Now when I go to my patients layout I have the global date as explained above through a value list to display only visits for that patient. So I see John Doe visited on Feb 9 and 13 - If I click on Feb 9 the portal below displays headache and sorethroat only.

                      I have then another portal from symptoms that then explains details about each symptom and I am able to see then all symptoms in this case I see details, for headache, sorethroat, and stomach ache.

                      I need to limit this portal to only show the symptoms details that we found on Feb 9th - I need to do that by only displaying symptoms when I click on the portal row that displays the symptoms found on Feb 9th

                      So my layout has a global date - to display symptoms in one portal, then a second portal should display only symptoms details by that visit, and only and if I click on a portal row in Portal Number 1

                      Let me know if you can help


                      • 8. Re: Portals

                        Furthermore, I think what I need is a script so that displays the details of the symptoms as I click on the portal row in another portal.

                        Am I thinking Correclty?  If so, can you help me with the script?


                        • 9. Re: Portals

                          Hi Phil,

                          I dont know if you gave up on me.  But here is what I have corrected.

                          I changed the Global Date field to my visits table and I relate this to display all the symptoms for that visit. 

                          Where GVisit - Symptoms A_Z

                          This allows me to display on the patient layout the global date which only displays dates from that patient and it shows me the symptoms for that visit.

                          I am also now able to see the details of each symptom that relates to that visit.  

                          I am stuck now as I cannot make it so that I can scroll down the master portal and see the details of the highlighed portal row.


                          • 10. Re: Portals

                            Sorry, but didn't choose to access the forum while sitting in the Emergency Room with my wife and was too busy to check back after they gave her the Ok to come home. See my reply to your new post.

                            • 11. Re: Portals

                              Sorry to hear -  Hope all is OK.

                              I have answered the questions you asked me on the new post.

                              Thanks again