6 Replies Latest reply on Mar 20, 2009 7:08 AM by TSGal

    Layout name by calculation option in Go to Related Record not working properly

    johnnyb1

      Summary

      Layout name by calculation option in Go to Related Record not working properly

      Description of the issue

      FileMaker Product(s) involved:FileMaker Pro Advanced 10.0v1 Operating System(s) involved:Win XP sp3Detailed description of the issue:I'm trying to format a button in a portal layout to Go to Related Record, and switch to the appropriate layout name based on the data in a field. The Case function calculation only responds to the value in the first row of the portal. I've done this several times in previous versions, and I know the relationships, formatting, and calculation are correct. The function works properly when the same file is opened in FileMaker Pro version 9. Exact steps to reproduce the issue:In a Contacts table I have a portal to a related table called Activities. There are three types of Activities - Phone Calls, Meetings, and Errands. I create an Activity record in the portal by selecting the Activity type from a drop-down list. After other basic data is entered in fields in the portal row, I want to click on a button to take me to the more comprehensive layout that corresponds to the Activity type. The button is set up to Go to Related Record and select layout name by calculation (Case function).  Expected Result:If portal row 1 is a Phone Call, portal row 2 is a Meeting, and portal row 3 is an Errand, clicking on the button in any of the portal rows should take me to the corresponding layout. The button in portal row 1 should take me to the Phone Call layout, portal row 2 to the Meeting layout, etc. Actual Result:Clicking on the button in any of the portal rows takes me to the layout corresponding to the value in the first portal row. So if portal row 1 is a Phone Call, portal row 2 is a Meeting, and portal row 3 is an Errand, clicking on any portal row button takes me to the Phone Call layout. Changing the value in portal row 1 changes the layout it goes to in all portal rows. Exact text of any error message(s) that appeared:N/A Any additional configuration information/troubleshooting that is relevant to the issue:1.  I re-created the calculations, checked relationships, and rebuilt portals to make sure everything was correct. 2.  Not using the calculation and specifying a single layout works properly. Using the If function, it always goes to Result Two. 3.  I opened the same file in FileMaker Pro version 9 (not Advanced) and it worked correctly.  Any workarounds that you have found:None.

        • 1. Re: Layout name by calculation option in Go to Related Record not working properly
          TSGal

          johnnyb:

           

          Thank you for your post.

           

          I have tried this on both Macintosh OS X 10.5.5 and Windows XP sp3, and I cannot duplicate the problem.  This is what I have done...

           

          I created a new database file with two tables.  Table A has two fields (ID and Name).  Table B has two fields (ID and Product).  I linked the two tables together using "ID" as the key field.

           

          In Table B, I created the following six records:

           

          (ID - Product)

          1 - Small Widget

          1 - Medium Widget

          1 - Large Widget

          2 - Dogs

          2 - Cats

          2 - Birds

           

          I duplicated this layout three times and named them "Layout 3", "Layout 4" and "Layout 5"

           

          I switched to the first layout that contains Table A fields, and created a portal into Table B only showing the Product field.

           

          I created a script titled "Portal Row" with the script steps:

           

          Set Variable [ $row ; Value: Get (PortalRowNumber) ]

          Go to Related Record [ From table: "Table B" ; using layout: $row + 2 ]

           

          Using the oval tool, I created a small circle on the layout, made this a button to execute the script "Portal Row".

           

          I go to Browse, enter a Name and an ID of "1".  The three "Widget" records appear in the portal.  If I put my cursor in the second portal and click the button, I am switched to "Layout 4".  If I return to Table A layout, put my cursor in the third portal and click the button, I am switched to "Layout 5".  Repeating again, putting my cursor in the first portal and clicking the button takes me to "Layout 3".

           

          I'm not sure what else to try here.

           

          Let me know the exact script steps and I will try to duplicate it here.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Layout name by calculation option in Go to Related Record not working properly
            johnnyb1
              

            Thanks, TSGal. But what I'm talking about is something like this:

             

            Create a file with two tables, Contacts and Activities. Fields are like so:

             

            CONTACTS

            Contact ID (auto-enter serial no.) - Primary Key

            FName

            LName

             

            ACTIVITIES

            Activity ID (auto-enter serial no.) - Primary Key

            Contact ID (link to Contact ID in CONTACTS table)

            Activity Type - use custom value list containing the values Phone Call, Meeting, and Errand

            Activity Description

             

            Duplicate the Activities layout 3 times and name them Phone Call, Meeting, and Errand.

             

            Put a portal in the CONTACTS layout to the ACTIVITIES table. Include the fields Activity Type, Activity ID, and activity Description.

             

            Put a button in the portal row to Go to Related Record and show record using layout name by the following calculation:

             

            Case ( Activities::Activity Type = "Phone Call" ; "Phone Call" ; Activities::Activity Type = "Meeting" ; "Meeting" ; Activities::Activity Type = "Errand" ; "Errand" )

             

            Create a contact record. Go into the portal and use the drop-down list to create three records, for Phone Call, Meeting, and Errand. Clicking on the button should take you to the layout that corresponds to the activity type.

             

            I just created this test DB in Advanced Version 10, and it does not work properly. I exited out and opened it in version 9, and it works fine.

             

             

             

            • 3. Re: Layout name by calculation option in Go to Related Record not working properly
              TSGal

              johnnyb:

               

              Thank you for the clarification.  I can definitely duplicate the problem.

               

              As a workaround, use the example I provided above.  That is, create a script that stores the Case function to a variable, and then call the layout based upon the variable.  Attach the script to the button, and you'll see it works.

               

              Set Variable [ $var ;  Case ( Activities::Activity Type = "Phone Call" ; "Phone Call" ; Activities::Activity Type = "Meeting";

                 "Meeting" ; Activities::Activity Type = "Errand" ; "Errand" ) ]

              Go to Related Record [ From table: "Activities" ; Using layout $var ]

               

              (Using your simplistic example, you could store the Activity Type directly to $var.)

               

              In any case, I have forwarded the information to our Development and Software Quality Assurance (Testing) departments so they can be aware of this issue and change it in a future release.  If I hear any additional information, I'll let you know.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Layout name by calculation option in Go to Related Record not working properly
                Lorenzo
                  

                I have converted to 10.0v1 on same kind of windows computer and server and also found the Full "Go to Related Record" using "Layout Name by calculation..." to be broken in 10 but ok in fmp 9.

                 

                I did find 2 work arounds.  

                 

                1.  My old script step the "Result Options" were to show in same window.  If I Selected the "Result Options to "Show in new window"  then the script step would now work and go to the correct "Layout Name by calculation..."  When I put it back again it failed consistently.

                 

                2. Ok something is broke with the whole command.  Now I tried to brake the one step into 3 steps.

                   first step: "Go to Related Record" and show the record on a layout in the table with the data, showing only the related rccords and matching the current record only.

                   second step: "Go to Layout" and select its "Layout Name by calculation..."

                   third step:  Put a "Freeze Window" step in front of these two. And a "Refresh Window" after the steps.

                • 5. Re: Layout name by calculation option in Go to Related Record not working properly
                  johnnyb1
                     I also found a workaround. I insert an Open File step in the script.
                  • 6. Re: Layout name by calculation option in Go to Related Record not working properly
                    TSGal

                    Lorenzo:

                     

                    Thank you for your post.

                     

                    I have attached your post to the original case.

                     

                    By the way, our Testing department has confirmed this is not working the way as expected (not surprised).  No additional information is available.

                     

                    TSGal

                    FileMaker, Inc.