1 2 Previous Next 25 Replies Latest reply on Dec 4, 2012 4:01 PM by EricaJackson

    Script for go to related records

    EricaJackson

      Title

      Script for go to related records

      Post

           Hello (again!)

           I am using Anchor Bouy format. The 2 pertinent tables are CLIENT  and VISIT.  on a Layout based on the VISIT Table, I have a portal based on a CLIENT T.O.  that is joined by a global field "status" and I can sort the portal to show the clients in order of their status. I would like a button on the portal that would let me click the client Id number and then pull up the client's related visit records on that layout.  I tried the button setup  and getting the found set from the visit_Client table (this is linked by the client ID) and I tried using the table joined by the global field... I keep getting "can't dsplay" error messages

           I'm sure I'm not using the right path or do I need a more elaborate script to accomplish this task?

           Thanks

           Erica

        • 1. Re: Script for go to related records
          philmodjunk

               Your Go To Related Record step should specify the Client T.O. on which the portal is based as the "table". (The name shown in the lower left corner of the portal and also in "Show Related Records From" in portal setup...) The layout that you specify can be any layout that refers to any TO for the same data source table as the TO used in the portal.

          • 2. Re: Script for go to related records
            EricaJackson

                 But the Layout is based on the VISIT Anchor and the portal is the Client Bouy used as the data source table....I am in the Layout based on the VISIT layout based on the VISIT table. I was able to do this with a global date field and the click takes me to the VISIT record linked with that clinet on the date... I owe that to all of you developers....it works and I'm ecstatic but I want a list (in the same layout) that shows the active clients and will go to the found set of visit records (in the main Visit layout). I have tried to do it as you suggested, (every combination I can think to try actually) I'm thinking this might be a relationship problem,  the CLIENT has a one to many relationship with the VISIT ?   I sort of understand why the global date button works... It is going to one Visit Record For that one Client...and I think understand why it won't work here, the global date is limited to that specific date Is this a directional thing with the go to related record? Or there are too many to choose from? As usual I am lost but very appreciative of all your help.

                 Thanks

                 Erica

                  

            • 3. Re: Script for go to related records
              philmodjunk

                   Can you upload a screen shot of Manage | Database | Relationships?

                   If your portal is to the records you want to see as a found set, then you have a relationship in place that can be used with GTRR to bring up those records in a found set on another layout.

              • 4. Re: Script for go to related records
                EricaJackson

                     Hi Phil

                     Here is the picture I hope it has the necessary info.  I don't begin to understand how these things work together. I probably need a more elaborate script to accomplish this task .... Thanks again!

                      

                • 5. Re: Script for go to related records
                  philmodjunk

                       I think you need a table occurrence, VISIT_visit_Id_clt

                       VISIT-----<VISIT_visit_Id_clt

                       VISIT::ID_CLT = VISIT_visit_Id_vst::ID_CLT

                       I am assuming that ID_CLT is the client ID and that you want to pull up all visit records for the current client.

                       If that is all correct, then:

                       Go To Related Record [Show only related records; From table: VISIT_visit_Id_vst ; Using layout: "VISIT_visit_Id_vst" (VISIT_visit_Id_vst)]

                       Any layout based on an occurrence of VISIT can be used as the target layout for this step.

                  • 6. Re: Script for go to related records
                    EricaJackson

                         When I added the TO and based the portal off that (with an additional Client TO) and the Fields are from The Client TO, The portal Displays a list of the Visit Dates for that one client ....clicking the ID button then brings up the Visit date for that one client in the main body of the Layout. So a little Serenditpity, I'm sure I will find a use for this portal setup. 

                         But it doesn't accomplish what I previously described. Any other ideas?

                         Thanks!

                    • 7. Re: Script for go to related records
                      EricaJackson

                           I also tried it with just the one table occurance you suggested.... I also tried to use a global field for the client ID .... not working.....

                            

                      • 8. Re: Script for go to related records
                        philmodjunk

                             In your last screen shot, you wrote on the layout: "I would like a button that would go to the previous visit dates for this client"

                             From that, I understood that this was what you wanted, a way to pull up a found set of all visit records for a given client. Is that not what you wanted?

                        • 9. Re: Script for go to related records
                          EricaJackson

                               Success! What it wasn't doing was pulling up the record in the body of the layout but it was my bad, I didn't have the appropriate source for the field. I inadvertently was trying to apply the GTRR to the first portal, Not the new one I created. And I just noticed that when I click on the global date portal, the new one automatically pops up and then if I need to address one of those visits, I have put the GTRR in VISIT ID. 

                               Thanks So much Phil, especially for your patience. You have a gift, you are a great teacher!

                               Erica

                          • 10. Re: Script for go to related records
                            EricaJackson

                                 I spoke too soon, Phil,   I'm going to backtrack a little. So as it stands now there are 3 portals.  Portal 1 Shows all the Clients for one Visit date and now the 3rd Portal displays all of the visits for the highlighted client. The 2nd Portal displays a list of all the current clients(whether or not they have an appointment on that gdate).  So What I need to be able to do is to click on a Client within the Second Portal (because there will be clients in that list that are not currently scheduled for that day and won't show up in the first list, but we may need to add one in) and again I need this because of FM GO delays in switching screens.  I'm trying to be very meticulous with naming the tables so I can keep them straight. Not the easiest thing to get a grip on.

                                 Erica

                            • 11. Re: Script for go to related records
                              philmodjunk

                                   So you want to click on a record in the 2nd portal.

                                   But what records should appear when you click on it? All the visit records for that client? or ??

                                   And on what layout? the same layout or a different layout?

                              • 12. Re: Script for go to related records
                                EricaJackson

                                     Hey Phil, I tried to clariy this somewhat with new screen shots... Thanks again for your patience.

                                • 13. Re: Script for go to related records
                                  EricaJackson

                                       To answer the questions you posted ( I sent the screen shot before I saw your post)

                                  So you want to click on a record in the 2nd portal.  YES

                                  But what records should appear when you click on it? All the visit records for that client? or ??  YES

                                       And on what layout?     the same layout  YES  but will probably need a 4th portal and then when clicking in that portal will bring the specific record into the main layout body. 

                                        

                                  • 14. Re: Script for go to related records
                                    philmodjunk

                                         Do you mean portal 2 as labeled in your most recent screen shot?

                                         Or the second portal in the previous screen shot?

                                    1 2 Previous Next