8 Replies Latest reply on Jun 29, 2016 1:38 PM by jrenfrew

    Script on filemaker server 15

    bremor

      Hi,

       

      I have created a script on filemaker but on filemaker-pro working and finish in 16 seconds, instead with filemaker server 4mins and 13 seconds...

       

      All script statements are compatible Server.

       

      Why there is this big difference? I think the fm-server must be faster than fm-pro.

       

      Thanks in advance,

      Andrea

        • 1. Re: Script on filemaker server 15
          mikebeargie

          we have no idea what your script does. Please post a copy of it so we can try and answer your question.

          • 2. Re: Script on filemaker server 15
            bremor

            Consenti interruzione utente [ Disattivata ]

            Imposta cattura errori [ Attivata ]

            Vai al formato [ “DEVELOPER” (DEV) ]

            Mostra tutti i record

            Esegui la ricerca [ Richieste di ricerca specificate: Ricerca dei record; Criteri: DEV::DATE_MODIFY: “// *:*:*” AND DEV::

            tb_ProductID: “*”][ Ripristina ]

            If [ Get(UltimoErrore) = 0 ]

                 Arresta Script

            End If

            Imposta variabile [ $trovati; Valore:Get(ContoTrovati) ]

            Ordina i record [ Mantieni record ordinati; Ordinamento specificato: DEV::code_article; ascendente ][ Ripristina; Senza finestra ]

            Vai a Record/Richiesta/Pagina[ Primo ]

            Loop

            Imposta variabile [ $ricavacodicestart; Valore:Get(IndicatoreDataOraCorrente) ]

            Imposta variabile [ $ricavacodicefine; Valore:Get(IndicatoreDataOraCorrente) ]

            Imposta variabile [ $anagraficastart; Valore:Get(IndicatoreDataOraCorrente) ]

            Imposta variabile [ $JS; Valore:"j={ JSON CALL }

            Imposta variabile [ $URL; Valore:"httppost://test.com/test.php?" & $JS }

            Inserisci da URL [ DEV::tb_return ; $URL ]

            Imposta campo [ DEV::tb_UpdateResult; JS_Parse ( DEV::tb_return; "descrizione") ]

            Imposta campo [ DEV::tb_ProductID; JS_Parse ( DEV::tb_return; "product_id") ]

            Imposta campo [ DEV::tb_UpdateDate; Get ( IndicatoreDataOraCorrente ) ]

            End If

            Vai a Record/Richiesta/Pagina[ Successivo; Esci dopo l'ultimo ]

            End Loop

             

            It's a simply JSON CALL and writing in filemaker the answare, id_product and update date.

            • 3. Re: Script on filemaker server 15
              mikebeargie

              My Italian is non-existant, but I have highlighted some suspicious lines from running this through a translator:

              Consenti interruzione utente [ Disattivata ]

              Imposta cattura errori [ Attivata ]

              Vai al formato [ “DEVELOPER” (DEV) ]

              Mostra tutti i record

              Esegui la ricerca [ Richieste di ricerca specificate: Ricerca dei record; Criteri: DEV::DATE_MODIFY: “// *:*:*” AND DEV::

              tb_ProductID: “*”][ Ripristina ]

              If [ Get(UltimoErrore) = 0 ]

              Arresta Script

              End If

              Imposta variabile [ $trovati; Valore:Get(ContoTrovati) ]

              Ordina i record [ Mantieni record ordinati; Ordinamento specificato: DEV::code_article; ascendente ][ Ripristina; Senza finestra ]

              Vai a Record/Richiesta/Pagina[ Primo ]

              Loop

              Imposta variabile [ $ricavacodicestart; Valore:Get(IndicatoreDataOraCorrente) ]

              Imposta variabile [ $ricavacodicefine; Valore:Get(IndicatoreDataOraCorrente) ]

              Imposta variabile [ $anagraficastart; Valore:Get(IndicatoreDataOraCorrente) ]

              Imposta variabile [ $JS; Valore:"j={ JSON CALL }

              Imposta variabile [ $URL; Valore:"httppost://test.com/test.php?" & $JS }

              Inserisci da URL [ DEV::tb_return ; $URL ]

              Imposta campo [ DEV::tb_UpdateResult; JS_Parse ( DEV::tb_return; "descrizione") ]

              Imposta campo [ DEV::tb_ProductID; JS_Parse ( DEV::tb_return; "product_id") ]

              Imposta campo [ DEV::tb_UpdateDate; Get ( IndicatoreDataOraCorrente ) ]

              End If

              Vai a Record/Richiesta/Pagina[ Successivo; Esci dopo l'ultimo ]

              End Loop

               

              It's a simply JSON CALL and writing in filemaker the answare, id_product and update date.

               

              You do not need to show all records before performing a find (line 4)

              Line 7 - this should be = 401, otherwise it would just exit all the time if it found something because "0" is "No error"

              You shouldn't have to sort records if you're just going to loop through the entire found set.

              You have an "End If" that has no matching "If" to open it up.

               

              The only thing that could be slowing down the script is the "Insert From URL" itself, or if there are summary fields on the "DEVELOPER" layout that need to be re-summarized before and after the finds.

              • 4. Re: Script on filemaker server 15
                Mike_Mitchell

                What script or scripts run when the file opens? The OnFirstWindowOpen trigger will fire when you start the server-side session. This may be the source of the issue.

                • 5. Re: Script on filemaker server 15
                  bremor

                  "You do not need to show all records before performing a find (line 4)"

                  ok

                   

                  "You shouldn't have to sort records if you're just going to loop through the entire found set."

                  ok

                   

                  "Line 7 - this should be = 401, otherwise it would just exit all the time if it found something because "0" is "No error" "

                  and

                  "You have an "End If" that has no matching "If" to open it up."

                  Yes sorry my fault when I copied and pasted here. It's : If [ Get(UltimoErrore) 0 ]

                   

                   

                  The only thing that could be slowing down the script is the "Insert From URL" itself, or if there are summary fields on the "DEVELOPER" layout that need to be re-summarized before and after the finds.

                  There aren't any summary fields.

                  The istruction "Insert from URL" you think it's more slow on filemaker-server than filemaker-pro?

                  • 6. Re: Script on filemaker server 15
                    mikebeargie

                    It has not been slower in my experience, but you are counting on a remote page (not filemaker) to send the contents of that request, so it is a potential slow point.

                     

                    Did you see Mike Mitchell’s suggestion about the OnOpen script that will run as well?

                    • 7. Re: Script on filemaker server 15
                      hellberg

                      Are you running this script from the client with the file on the server or are you running this script thru preform script on server? It seems a bit unclear for me.

                      • 8. Re: Script on filemaker server 15
                        jrenfrew

                        This  is a case where down some proper logging will really help uncover the issues.

                         

                        I recently did she testing with a client which demonstrated that the problem and not the server script which ran in under 20 milliseconds, (avoiding OnOpen script of course) the the issue was the 1500 milliseconds round trip, twice.

                        Their network was the issue, not the script.

                         

                        Until you provide lots of measurements about the time taken for EACH step of the process then it will be somewhat guessing in the dark to offer more help....