2 Replies Latest reply on Mar 3, 2014 11:43 AM by willrollo

    Unable to close popover

      Title

      Unable to close popover

      Post

           Hi

           I have made a simple popover with a quickfind field within. Once the script has run, I want the popover to close. But it wont do it from the script except for the part I have highlighted in Green. I have put the close popover script step in various places in the script but with no success. Does anyone have any suggestions? The script runs via a trigger - onObjectExit.

           I also have an OnObjectEnter ST that is a go to field to save clicking into the gContact Search field .
           Thank you

            

             
      •           Commit Records/Requests
      •      
      •           Set Error Capture [ On ]
      •      
      •           If [ IsEmpty(CUSTOMERS::gContact Search) ]
      •      
      •           Show Custom Dialog [ Title: "Error"; Message: "Please enter text to search for or leave empty to show all enquiries"; Default Button: “Show All”, Commit: “Yes”; Button 2: “Edit”, Commit: “No”; Button 3: “Cancel”, Commit: “No” ]
      •      
      •           If [ Get(LastMessageChoice)=1 ]
      •      
      •           Go to Layout [ “ContactList” (CUSTOMERS) ]
      •      
      •           Show All Records
      •      
      •           Perform Find [ Specified Find Requests: Omit Records; Criteria: CUSTOMERS::Type: “FL” ] [ Restore ]
      •      
      •           End If
      •      
      •           If [ Get(LastMessageChoice)=3 ]
      •      
      •           Close Popover
      •      
      •           Exit Script [ ]
      •      
      •           End If
      •      
      •           If [ Get(LastMessageChoice)=2 ]
      •      
      •           Go to Layout [ “ContactList” (CUSTOMERS) ]
      •      
      •           Set Variable [ $Data; Value:CUSTOMERS::gContact Search ]
      •      
      •           Perform Quick Find [ $Data ]
      •      
      •           If [ Get(LastError) ≠ 0 ]
      •      
      •           Show Custom Dialog [ Title: "Error"; Message: "There are no enquiries with the text " & CUSTOMERS::gContact Search & ". Please alter the search criteria."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
      •      
      •           Go to Layout [ “ContactList” (CUSTOMERS) ]
      •      
      •           Show All Records
      •      
      •           Perform Find [ Specified Find Requests: Omit Records; Criteria: CUSTOMERS::Type: “FL” ] [ Restore ]
      •      
      •           Go to Record/Request/Page [ First ]
      •      
      •           End If
      •      
      •           End If
      •      
      •           Else
      •      
      •           Go to Layout [ “ContactList” (CUSTOMERS) ]
      •      
      •           Set Variable [ $Data; Value:CUSTOMERS::gContact Search ]
      •      
      •           Perform Quick Find [ $Data ]
      •      
      •           If [ Get(LastError) ≠ 0 ]
      •      
      •           Show Custom Dialog [ Title: "Error"; Message: "There are no enquiries with the text " & CUSTOMERS::gContact Search & ". Please alter the search criteria."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
      •      
      •           Show All Records
      •      
      •           Perform Find [ Specified Find Requests: Omit Records; Criteria: CUSTOMERS::Type: “FL” ] [ Restore ]
      •      
      •           Go to Record/Request/Page [ First ]
      •      
      •           Else
      •      
      •           Go to Layout [ “ContactList” (CUSTOMERS) ]
      •      
      •           Close Popover
      •      
      •           End If
      •      
      •           End If

        • 1. Re: Unable to close popover
          philmodjunk

               Nothing really jumps out as seriously wrong here. I don't, however see the need for the go to layout step just before the Close Popover step as it appears that you are already on that layout.

               I will note that this step is inside an If block. The popover will close only if the quick find finds some records.

               If you have FileMaker Advanced, you might want to use the debugger to step through this script and see if you can spot where things might be failing to do what you expected.

               Commit Records/Requests
               Set Error Capture [ On ]
               If [ IsEmpty(CUSTOMERS::gContact Search) ]
                   Show Custom Dialog [ Title: "Error"; Message: "Please enter text to search for or leave empty to show all enquiries"; Default Button: “Show All”,
                              Commit: “Yes”; Button 2: “Edit”, Commit: “No”; Button 3: “Cancel”, Commit: “No” ]
                   If [ Get(LastMessageChoice)=1 ]
                       Go to Layout [ “ContactList” (CUSTOMERS) ]
                       Show All Records
                       Perform Find [ Specified Find Requests: Omit Records; Criteria: CUSTOMERS::Type: “FL” ] [ Restore ]
                   End If
                   If [ Get(LastMessageChoice)=3 ]
                       Close Popover
                       Exit Script [ ]
                   End If
                   If [ Get(LastMessageChoice)=2 ]
                       Go to Layout [ “ContactList” (CUSTOMERS) ]
                       Set Variable [ $Data; Value:CUSTOMERS::gContact Search ]
                       Perform Quick Find [ $Data ]
                       If [ Get(LastError) ≠ 0 ]
                           Show Custom Dialog [ Title: "Error"; Message: "There are no enquiries with the text " & CUSTOMERS::gContact Search & ". Please alter the
                               search criteria."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                           Go to Layout [ “ContactList” (CUSTOMERS) ]
                           Show All Records
                           Perform Find [ Specified Find Requests: Omit Records; Criteria: CUSTOMERS::Type: “FL” ] [ Restore ]
                           Go to Record/Request/Page [ First ]
                       End If
                   End If
               Else
                   Go to Layout [ “ContactList” (CUSTOMERS) ]
                   Set Variable [ $Data; Value:CUSTOMERS::gContact Search ]
                   Perform Quick Find [ $Data ]
                   If [ Get(LastError) ≠ 0 ]
                       Show Custom Dialog [ Title: "Error"; Message: "There are no enquiries with the text " & CUSTOMERS::gContact Search & ". Please alter the
                                  search criteria."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                       Show All Records
                       Perform Find [ Specified Find Requests: Omit Records; Criteria: CUSTOMERS::Type: “FL” ] [ Restore ]
                       Go to Record/Request/Page [ First ]
                   Else
                       Go to Layout [ “ContactList” (CUSTOMERS) ]
                       Close Popover
                   End If
               End If

          • 2. Re: Unable to close popover

                 Thanks Phil - will check the debug again. I added the go to layouts as I thought it may have helped somehow...