10 Replies Latest reply on Nov 30, 2011 11:24 PM by xtremu

    Problem to display current record from portal row to another layout for printing

    xtremu

      Title

      Problem to display current record from portal row to another layout for printing

      Post

       Im new in coding and am using Filemaker Pro 11 Advanced and working on a simple book borrowing system. I have 3 tables (book,student and history tables) and it works good except the printing layout that I made. In my book database layout I created portal to show fields like StudentName, check out date and time, due date and time, check in date and time. It's sorted portal records through check in time (descending order) for us to show this current record in the first row of the portal in the database layout. I created compute button to bring me in the printing layout having the same fields in the portal. Now, the problem is that the record shown in the fields in the printing layout is the first record let say it's 2 days old already and not the last or the current record we check in.

      For example In my portal in the book database layout i have fields and records such as:

      StudentName    Checkoutdate  checkouttime duedate         duetime     checkindate    checkintime         etc...

      Robert Sy          11-17-2011    2:00PM         11-20-2011   10:00AM    11-20-2011     10:00AM 

      Randy Uy           11-19-2011    2:00PM        11-20-2011   11:00AM    11-20-2011     01:00PM 

      Richard Lim        11-19-2011    3:00PM        11-20-2011   09:00AM    11-20-2011     11:00AM   

      Supposedly the second record will be in the first row of the portal because it was sort in descending order based on the checkin time (01:00PM) is the last or recent time we recorded or transact and need to show in the printing layout and ready to print, what happpened is that the first row (Robert Sy) is still in the fields of the printing layout which is supposedly the second row (Randy Uy)should appeared because it is the current and last record we made.

      Is their any way or script that can update or can bring the current record from the portal of the book database layout to the fields in the printing layout so that you can print it right away?

      Thanks

      xtremu

        • 1. Re: Problem to display current record from portal row to another layout for printing
          philmodjunk

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

          Will bring up the current record from the portal on a second layout for printing.

          The typical way to ensure that the correct portal row is the "current row" is to place a button to perform this script inside the portal row. That way, the mouse click that performs the script also selects the desired record that you want to see on the other layout.

          • 2. Re: Problem to display current record from portal row to another layout for printing
            xtremu

             Phil, I had already the button called COMPUTE and used that to run the script you suggested but does not work, last record let say (Jason Bagasbas Aballa) is still in the Printing layout field instead of Joyce Anne Zamora Abante. (please refer to the picture below)

            By the way, my portal is in the Book Database layout and my fields such as StudentName, Check out date and time, Due date and time, Check in date and time  etc.. were in another layout called Printing layout.

            Here is the script for my COMPUTE button and also tried to create another button and place that inside the portal but the same result happened:

            (Go To Related Record[Show only related records;Match found set;From table: "Book Database"; Using layout:"Printing layout"(Book Database)]

            What is the missing script or what is the problem Phil?

            thanks for the quick replied, hope you can help me this.

            xtremu

            • 4. Re: Problem to display current record from portal row to another layout for printing
              xtremu

               Yes I Phil I tried to do that already, I used Match current record only and Match all records in the current found set but (Jason Bagasbas Aballa) is still in the Printing layout field. By the way the picture below in the previous picture is the fields in the printing layout Phil. Any idea Phil?

              What if Phil "The typical way to ensure that the correct portal row is the "current row" is to place a button to perform this script inside the portal row. That way, the mouse click that performs the script also selects the desired record that you want to see on the other layout". Can you please give me the step by step instruction how to do this and what is the script of this?

              Thanks

              • 5. Re: Problem to display current record from portal row to another layout for printing
                philmodjunk

                Can you please give me the step by step instruction how to do this and what is the script of this?

                I use this method all the time to add a "delete" button to a portal so that the user can click it to delete a selected portal record. There isn't much step by step involved here.

                You just have to put the button that runs your script inside the portal so that the button appears on every portal row. Then if you want to see the related record for "Jayson.....", You click the button in this person's portal row and the Go To Related Record script step will then pull up all the related records shown in your portal, but the record for "Jayson...." will be the current record. If you then print with the "current record" not "records being browsed" option, you will see just the record for "Jayson..." printed.

                If, however, you enter preview mode at this point, you will see all the records from the portal previewed--starting with the first record in the portal--"Joyce Ann..." in this case. That's because Preview always assumes that the user will print with the records being browsed option. You can easily limit your found set to the current record before entering preview if this is the situation you are dealing with here.

                In a single user database:

                Show All records
                Omit Record
                Show Omitted Only

                will quickly isolate the current record in a found set of just that record.

                In a shared, multi-user database:

                Set Variable [$ID ; value: YourPOrtaltable::PrimaryKey ]
                Enter find mode[]
                Set field [YourPortalTable::PrimaryKey ; $ID]
                Constrain Found Set []

                will do the same. (in multi-user Dbs, first method can, on rare occasions, include a new record created by another user.)

                • 6. Re: Problem to display current record from portal row to another layout for printing
                  xtremu

                   Phil I already put button inside the portal and made a script that u suggested to run it but whatever button did I click still "Jayson" is still remain in the printing layout. (sinlge user database). What is the problem Phil?

                  See Picture below and the script I used:

                  Go to Related Record [Show only related records; From table:"Book Database"; Using layout: "Printing layout " (Book Database)]

                  Show All Records

                  Omit Record

                  Show Omitted Only

                   

                  • 7. Re: Problem to display current record from portal row to another layout for printing
                    philmodjunk

                    In layout setup for the layout where you have this portal, what is listed in "Show Records From"?

                    In portal set up for the above portal, what is listed in "show related records from"?

                    • 8. Re: Problem to display current record from portal row to another layout for printing
                      xtremu

                       Phil layout setup show related records from "Book Database"and portal setup show related records from "History Book ID".

                      thanks..

                       

                      • 9. Re: Problem to display current record from portal row to another layout for printing
                        philmodjunk

                        You've got me scratching my head here. This is a process that works well for me, used it any numver of times. The specified table occurrences in your layotu and portal setup dialogs rules out the possibility that your GTRR step was referring to the wrong table occurrence.

                        A few more questions:

                        Is the name field shown in the portal defined in History, or is it defined in a related table of borrowers?

                        Do you have FileMaker Advanced? If so enable the script debugger and then click the button to run this script. Step through the script in the debugger and see if you get any unexpected script trigger controlled scripts popping up and interferring with this script. Also look for any unexpected changes as to which portal row is "current" before the GTRR step is executed.

                        If you do not have FileMaker Advanced, check for any layout based script triggers on the Printing Layout and any field or portal based triggers on the Portal and its fields to see if any triggered scripts may be changing the current record either just before the GTRR step (portal triggers) or immediately after (Layout based triggers in Print Layout).

                        Also, you might try posting your complete script here for us to see.

                        To post a script to the forum:

                        1. You can upload a screen shot of your script
                        2. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
                        3. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
                        4. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional look to your script. (Use the HTML option and paste the text into the HTML editor.)
                        • 10. Re: Problem to display current record from portal row to another layout for printing
                          xtremu

                           Thanks for the reply Phil, just read your response this afternoon.

                          1. Is the name field shown in the portal defined in History, or is it defined in a related table of borrowers? YES Phil

                          2. Do you have FileMaker Advanced? Yes Phil Im using FileMaker Pro 11 Advanced

                          "The specified table occurrences in your layotu and portal setup dialogs rules out the possibility that your GTRR step was referring to the wrong table occurrence."..

                          Thanks for the above suggestion and luckily I got it Phil, button that you suggested to put inside the portal used the GTRR step and bring me to the Printing layout and show the record/s that you want to print and it works fine. The COMPUTE button also works fine the same as the button inside the portal but you need to highlight only the portal row that you want to print before bring you to the printing layout.

                          Portal and Layout setup show related records should be the same Phil to completely works tha I completely miss too.. Thanks so much Phil..

                          Your the man..

                          P.S. I am planning to start now my Computerize Enrollment System (CES), can you please give me a guide or any flowchart or a simple CES with tables, fields, relationships, scripts of the system? Thanks again..

                          xtremu