10 Replies Latest reply on Apr 9, 2010 1:37 PM by icecreamboy

    Complete newbie asking for help...

    icecreamboy

      Title

      Complete newbie asking for help...

      Post

      Hi, I'm a complete beginner to FileMaker Pro. I'm currently operating on Windows XP, with FileMaker Pro Advanced 11.

       

      I'm trying to make a simple database with 2 tables: patients and appointments. There are also 2 layouts: patient view, and appointment view. In patient view, it's just general information about the patient. In appointment view, it's a list of all their appointments.

       

      I've learned how to make a button to "create a new patient" and "create a new appointment" but I can't seem to get them to connect. I made a relationship with a patient ID field in both tables.

       

      What I want is a button on the "patient view" layout that says "Go to appointment view". Then when I'm in "appointment view", I want a button that says "New appointment" and I want this new record to automatically be linked to the patient I was just on (for example, by auto-entering the patient ID or something).

       

      I seem to be unable to grasp how to do it, any help would be very much appreciated!

        • 1. Re: Complete newbie asking for help...
          icecreamboy

          Oh I also forgot to mention that I do know about portals. However, I intend for these layouts to be readily printable, and I've read that portals aren't that great for printing, which is why I opted for a "list view" type of layout for the "appointment view" layout.

          • 2. Re: Complete newbie asking for help...
            philmodjunk

            You can have both. You can use a portal for data-entry and your list type layout for printing the results. That approach can simplify things a bit for you.

             

            Note: you can create as many layouts as you need, you aren't limited to just one for each table.

            • 3. Re: Complete newbie asking for help...
              ninja

              Howdy icecreamboy,

              Welcome to FMP.

               


              icecreamboy wrote:

                

              What I want is a button on the "patient view" layout that says "Go to appointment view". Then when I'm in "appointment view", I want a button that says "New appointment" and I want this new record to automatically be linked to the patient I was just on (for example, by auto-entering the patient ID or something).


              Time to learn scripts:

              Put the "New Appointment" button on the Patient View layout.

               

              Create a script called "New Appointment" using scriptmaker.

               

              SetVariable [ $patientID ; Value: patientID ]   traps the ID# of the current record

              GoToLayout [ Appointment View ]   switches to your appointment layout

              New Record/Request     creates the new appointment record

              SetField [ patientID ; $patientID ]    sets the ID# to that of the patient

               

              Big Big OR here:

              Note that you can also put a PORTAL on your Patient View layout showing related records from Appointments.  Play around with this...you'll like it a lot.  With your portal set up, you can add an appointment for that patient right from the Patient View layout without having to change layouts and without having to run the above script...a big plus.


              • 4. Re: Complete newbie asking for help...
                icecreamboy

                Thanks for the quick reply, PhilModJunk.

                 

                So when I set up a portal (let's just say this portal is located on the "patient view" layout), how do I make it auto-enter the "current patient" ID in the portal's ID field?

                 

                Also, just as a side question, how would all of this be accomplished without the use of a portal?

                • 5. Re: Complete newbie asking for help...
                  icecreamboy

                  Thanks for the detailed explanation Ninja! I really appreciate it.

                   

                  Your script really helps. I was also wondering, how would I make a button in "Appointment view" layout that could make a "New appointment". My point is that I don't want to have to go to "Patient view" in order to make a "New appointment".

                   

                  And again from my previous reply, how do I capture the patient ID number when I use a portal so that it auto-enters it when I make a new record in the portal?

                  • 6. Re: Complete newbie asking for help...
                    philmodjunk

                    "how do I make it auto-enter the "current patient" ID in the portal's ID field?"

                    In the relationship graph (Manage | Database | Relationships)

                    Double click the line linking patients adn appointments and enable the option "Allow creation of records via this relationship" for the appointments side of the relationship.

                     

                    Now you can place a portal to appointments on the patients layout. WHen you type data into the bottom blank row of the portal, Filemaker will create a new appointment record and enter the Patient ID number into the matching ID field in this new appointments record for you.

                    • 7. Re: Complete newbie asking for help...
                      ninja

                      Howdy,


                      icecreamboy wrote:

                       

                      And again from my previous reply, how do I capture the patient ID number when I use a portal so that it auto-enters it when I make a new record in the portal?


                      Short Answer: Don't worry about it.

                      Longer answer: If you make a record through the portal (a portal being a thing that shows related records) FMP will assume that you want it to be related and will tag the appointment with the patientID of the patient record you are on.  It assumes that you wouldn't put an appointment for Mark into a portal on Jim's record...and will automatically add Jim's patientID...so...don't worry about it.  Try to make some records through the portal and verify this so you get comfortable with it.

                       


                      icecreamboy wrote:

                       

                      how would I make a button in "Appointment view" layout that could make a "New appointment". My point is that I don't want to have to go to "Patient view" in order to make a "New appointment".


                      And i figured that you would never have to go to the appointment record if you could see it through patient view...let's try another way.

                       

                      If you are on Appointment, and wanted to make an appointment for Jim, you'll want to use a value list.  When you make an appointment without the context of being on a patient record, FMP doesn't know who it is for, so you'll have to tell it.

                       

                      Create a value list based on the field Patient:: PatientID (call it "NameID")

                      Show values from a second field Patient:: PatientName (so you can recognize the guy's name)

                      Show ONLY values from the second field

                      Sort by the second field.

                      now go back out to layout mode

                      put your patientID# on your Appointment layout

                      Go to Field Setup (double-click the field)

                      Make the field a dropdown list (look on the upper left of the window)

                      Using values from a value list

                      Select the value list NameID

                       

                      Go to browse mode in the appointment layout and play with it.  When you click the field, you'll see a list of names.  When you select a name from the list, the value put into the field will actually be the first field "patientID" and you will have formed the relational link.

                       

                      Give it a whirl and post back.

                       

                      Edit: Phil and I seem to be tag teaming here...good thing we aren't contradicting each other ;)



                      • 8. Re: Complete newbie asking for help...
                        icecreamboy

                        Thank you both for your responses. I'm really beginning to grasp the concepts here!

                         

                        Ninja, for the second part of your response, I'm sorry that I didn't explain a little more clearly. This is what I was thinking will happen:

                         

                        -I'm on a patient, Jim, looking through his general information.

                        -I click on "appointment view" layout - and this only shows previous appointments for Jim.

                        -I click on "new appointment" and I want the new record to automatically know I'm only looking at Jim's appointment, and appropriately assign the ID number.

                         

                        That's the "new appointment" button I'm looking for :)

                         

                        The "value list" solution seems to be good if there are few patients, but if there are say hundreds of patients, wouldn't this make a huge dropdown list?

                        • 9. Re: Complete newbie asking for help...
                          ninja

                          Howdy,


                          icecreamboy wrote:

                          -I click on "new appointment" and I want the new record to automatically know I'm only looking at Jim's appointment, and appropriately assign the ID number.


                          Playin' with fire here...possible, yes.  Simply use the first script I posted and leave out the GoToLayout step.  Possible to break it accidentally and not notice that you did...also yes.  I would not choose to leave this loophole open.  If you go to Jim's records, change you mind, do a find for Mary's, then decide to make an appointment for Jim and hit the button...Mary's got a new appointment.

                           

                          one of the choices in the dropdown list is "autocomplete using value list...".  We use this with a list of 12000 material names and it is very user friedly.  when you click on the field and have a 900 name list show up, start typing.  The list will shorten very quickly (unless you cater only to people named John) and you can select among the three left.


                          • 10. Re: Complete newbie asking for help...
                            icecreamboy

                            Haha, all right, I understand :) I'd accept all of both of your posts as accepted solution if I could!

                             

                            I'll tinker with it more now and come back if I need more help. Thanks again, Ninja and Phil :)