8 Replies Latest reply on Sep 24, 2014 3:56 PM by SkipGilleland

    Go to Portal row doesn't appear to work

    SkipGilleland

      Title

      Go to Portal row doesn't appear to work

      Post

      I am including a image to help be clear.  The top image of the screenshot is on a Slide Panel (not sure if that matters).  When clicking any of the buttons on the right side (1.), the corresponding number should show up in the portal (2.), when another number is double tapped, it should add that number to the bottom of the portal.  (3.) when the numbers are double tapped # 3 on the top image should average the numbers.  Instead, what appears to be happening is that everytime a number is clicked (1.), it simply replaces the top portal row with the current number.  (looking at the table it looks as if it is just replacing the number in the table instead of adding it to the table.  I have included the script for the buttons, the formulas for the fields.  Any suggestions on anything to improve this would be greatly appreciated.

      Screenshot_9_24_14__4_26_PM.png

        • 1. Re: Go to Portal row doesn't appear to work
          philmodjunk

          From the screen shot and script, it looks like "allow creation of records via this relationship" has not been enabled for the portal's table in the underlying relationship. Thus go to portal row [last] puts the focus on the last record in the portal and updates it instead of putting the focus into a non-existent "add row" where the same set field would create a new record in the portal's table.

          There are ways a script can add a new record to the portal's table that do not require the "allow creation..." option and do not require interacting with the portal at all.

          • 2. Re: Go to Portal row doesn't appear to work
            SkipGilleland

            Not sure I understand this...

            There are ways a script can add a new record to the portal's table that do not require the "allow creation..." option and do not require interacting with the portal at all.

            Also it looks like the relationship is correct...see image. 

            • 3. Re: Go to Portal row doesn't appear to work
              philmodjunk

              Enter layout mode with your layout from above open. Double click the lower area of the portal to open up portal setup. Exactly what name is specified in "show related records from"?

              Not sure I understand this...

              What I am saying is that the method you are using to create a related record in the portal's table is not the only option for creating that related record. A script that interacts with a portal to create the record is a bit more "brittle" (easily broken by future changes to your layout) than a script that either a) changes layouts to a layout based on the portal's table and creates the new record there before changing back or b) uses a supplementary relationship with Set field to create the portal record without changing layouts.

              • 4. Re: Go to Portal row doesn't appear to work
                SkipGilleland

                It appears that I have "Hitting"

                • 5. Re: Go to Portal row doesn't appear to work
                  philmodjunk

                  What's curious (may be due to how it's formatted) is that I don't see the needed blank "add row" in the portal. Can you manually add a record in the portal by clicking into a blank row just below the last visible row of data?

                  Are there any other portals on this layout?

                  Note that go to portal row lacks any way to specify which portal on your layout it is going to interact with so issues can arise if there is more than one portal on your layout.

                  • 6. Re: Go to Portal row doesn't appear to work
                    SkipGilleland

                    I am unable to add a row manually. There are several portals on this layout. However at one time it was working.  I didn't create this script someone else. Is it possible to delete the go to Portal row in the script and delete the portal altogether?

                    • 7. Re: Go to Portal row doesn't appear to work
                      philmodjunk

                      What version of FIleMaker are you using? If this is v12 or v13, try this:

                      Enter layout mode and drag the portal a few pixels in one direction or another. Does the field in the portal row move with it?

                      If not, some edit to your layout has caused the field in the portal row to no longer be "owned" by the portal. Drag it out of the portal row completely, release the mouse button and then drag it back, being careful not to release the mouse button until the borders of the field are fully within the borders of the top portal row.

                      Since there are several portals on this layout, you need to modify your script and layout so that it interacts only with the correct portal.

                      While in layout mode, select the portal and use the Inspector's name box to give the portal an object name. Copy this name to the clipboard. Then open your script and add a go to object script step just before the go to portal row script step. Paste the copied object name from the clipboard into the go to object dialog so that your script now puts the focus into the correct portal before go to portal row then specifies a portal row.

                      • 8. Re: Go to Portal row doesn't appear to work
                        SkipGilleland

                        That did it!  Thank you very much....after your last post I remembered that I copied that portal from another layout.  So that may have been part of the issue.  But I did name the portal as well and put the "goto object" in my script.  Again thank you!