11 Replies Latest reply on Oct 19, 2013 8:44 AM by steve_ssh

    Go To Portal row error in FM Go

    raycon

      Hello,

       

      I have struck a "required table is not available" error when I run the below script in FM Go, but it runs perfectly on FMProAdv. There are not supposed to be behavioural differences between Pro and Go in the "Go To Portal Row" script step, but that's where is appears to be happening. It's annoying that I can't see whats happenning in the debugger, but I tracked it down by disabling steps one at a time. That messes up the script but it proved it was the GoToPortalRow step.

       

      Can anyone tell me what's happening? It works perfectly until I open it on the iPad! Darn!

       

       

      Main Scripts: iOS: Wamsars: WamsarCompletionChecks

      Go to Object [ Object Name: "Resource" ]

      Go to Portal Row [ First ]

      Loop
      If
      [ IsEmpty(RescueAssets_iPadEntry::RescueStart) or IsEmpty(RescueAssets_iPadEntry::RescueEnd) or RescueAssets_iPadEntry::RescueDuration 0 ]

      Show Custom Dialog [ Title: "Warning"; Message: "One of the start or the end times is empty or wrong.¶ Please set correct times."; Default Button: “OK”, Commit: “Yes”; Button 2: “No”, Commit: “No” ]

      If [ Get( LastMessageChoice)=1 ]
      Go to Field [ RescueAssets_iPadEntry::RescueStart ]

      Halt Script

      Else
      Go to Portal Row
      [ Last ]

      End If

      End If

      Exit Loop If [ Get(ActivePortalRowNumber) > (Count(RescueAssets_iPadEntry::__pkID_RescueAssets_iPadAuto)) ]

      Go to Portal Row [ Next ]

      End Loop

       

        • 1. Re: Go To Portal row error in FM Go
          ch0c0halic

          Maybe I'm missing the obvious but, there are three Go To Portal Row script steps used in the script. Are you saying all three fail?

          • 2. Re: Go To Portal row error in FM Go
            raycon

            That's correct.  All three.

            • 3. Re: Go To Portal row error in FM Go
              PSI

              I perfer to Go to a specific field in the portal instead of a object.

               

              Go To Field [ RescueAssets_iPadEntry::RescueStart ] instead of Go To Object []

               

              John

              • 4. Re: Go To Portal row error in FM Go
                raycon

                Thanks John.  I'll give that a try becasue it may just work.  The only reason for the goto object is that the portal is one of three, each of which reside on a tab control.  So the Go To Object gets the correct tab, then the Go To PortalRow etc.

                • 5. Re: Go To Portal row error in FM Go
                  steve_ssh

                  Hello Raycon,

                   

                  A couple of things:

                   

                  1) I'd love to hear how this works out for you, i.e. anything you learn about what was going wrong I hope you will post.

                   

                  2) Earlier this year LaRetta contributed a nice post regarding the topic of potential pitfalls with using GoToObject for navigation, specifically with focus on tab and portal navigation.  It has been a while since I downloaded her demo file and digested the information, so I'm not up to the task of writing a good synopsis here, but I think it might be a good read for you, given your current puzzle.

                   

                  Link to LaRetta's post:  https://fmdev.filemaker.com/message/120419

                   

                  Best regards,

                   

                  -steve

                  • 6. Re: Go To Portal row error in FM Go
                    raycon

                    Thanks Steve,

                     

                    Will do.  However I think I have it licked.  We are a volunteer marine rescue group in West Australia.  This app resides on iPads and references a served data file by 4G.

                     

                    This portal has a row for each vessel (we have five) involved in an incident. In a body search it could be all five.  The team leader has to make sure there are start and end times in the report for each vessel.

                     

                    I'm convinced I will have to forget about navigating the layout and simply search the underlying related records, but once I've tested that I'll post the result and (if it works) the comparison script step.

                     

                    Cheers,

                     

                    Ray

                    • 7. Re: Go To Portal row error in FM Go
                      steve_ssh

                      Hi Ray,

                       

                      Thanks for the context.  Not knowing what your plans are for "searching the underlying records", I'll just mention that using ExecuteSQL might serve you well for determining if you have an invalid rows (without having to necessarily leave the context of whatever the current layout may be).  This, of course, assumes that this is being developed/deployed with v.12.

                       

                      Very best,

                       

                      -steve

                      • 8. Re: Go To Portal row error in FM Go
                        raycon

                        Hi Steve,

                         

                        I am using 12, but found that ExecuteSQL is too slow over our mobile data networks.  Below is what it took to fix it.  I had to go to the underlying layout and query for related records then back to teh main layout.  Not elegant perhaps, but it works in Go, which the other did not.  I've also attached a screenshot of the layout in case you're interested.

                         

                        Thanks to all for the input and advice.

                         

                        Ray

                         

                         

                        Main Scripts: iOS: Wamsars: WamsarCompletionChecks
                        Set Variable
                        [ $RescueNum; Value:RescuesiPadEntry::__pkID_iPadEventAuto ]

                        Go to Layout [ “RescueAssets” (RescueAssets_iPadEntry) ] Enter Find Mode [ ]
                        Set Field [ RescueAssets_iPadEntry::RescueNum; $RescueNum ] Set Error Capture [ On ]
                        Perform Find [ ]
                        If [ Get(LastError) = 0 ]

                             Go to Record/Request/Page [ First ]

                             Loop
                                   If
                        [ IsEmpty(RescueAssets_iPadEntry::RescueStart) or IsEmpty(RescueAssets_iPadEntry::RescueEnd) or RescueAssets_iPadEntry::RescueDuration 0 ]

                                  Go to Layout [ original layout ]

                                  Show Custom Dialog [ Title: "Warning"; Message: "One of the start or the end times is empty or wrong.¶ Please set correct times."; Default Button: “OK”, Commit: “Yes”; Button 2: “No”, Commit: “No” ]

                                  If [ Get( LastMessageChoice)=1 ]
                                       
                        Go to Field [ RescueAssets_iPadEntry::RescueStart ] Halt Script

                                  Else
                                        Go to Record/Request/Page
                        [ Last ]

                                  End If          

                             End If

                             Go to Record/Request/Page [ Next; Exit after last ]

                             End Loop

                        Else

                             Go to Layout [ original layout ]
                             
                        Show Custom Dialog [ Title: "Warning"; Message: "There are no assets selected for this WAMSAR.¶ Do you wish to select one?"; Default Button: “OK”, Commit: “Yes”; Button 2: “No”, Commit: “No” ] If [ Get(LastMessageChoice)=1 ]

                             Go to Field [ RescueAssets_iPadEntry::RescueBoatAuto ]

                             Halt Script

                             End If

                        End If
                        Go to Layout
                        [ original layout ]

                         

                         

                         

                         

                        wamsar.jpg

                         

                        • 9. Re: Go To Portal row error in FM Go
                          steve_ssh

                          Hi Ray,

                           

                          Just a note to say thank you for the follow-up.  I appreciate hearing the info about slowness with ExecuteSql in conjunction with a mobile network -- that is factor to consider that hasn't yet sunk into my mind, so the reminder is good.

                           

                          Very best regards,

                           

                          -steve

                          • 10. Re: Go To Portal row error in FM Go
                            raycon

                            Hi Steve,

                             

                            Just wanted to apologise for brushing off ExecuteSQL.  I have just tested an ExecuteSQL statement in lieu of the loop I was running to check each portal row and it's much much faster, but then you knew it would be.

                             

                            Best

                             

                            Ray

                            • 11. Re: Go To Portal row error in FM Go
                              steve_ssh

                              Hi Ray,

                               

                              Thank you for the update.  Accurate or inaccurate, I'm glad that you made the earlier comment about speed over the mobile data network.  It is something that I should have considered, and, truth be told, it wasn't in my mind when I made my earlier comment.

                               

                              Very glad to hear that it keeps getting better.

                               

                              Thanks and best,

                               

                              -steve