9 Replies Latest reply on Jan 19, 2016 8:55 PM by sivagurS

    Perform Script on server not Working

    sivagurS

      I have a script to insert values to SQL table through execute SQL script.

      It runs fine when it is run on its own.

      But when I run it as a sub script, it does nothing.I tried getting any ErrorScript, but there is no errors returned.

       

      I am developing from the same machine that my Filemaker Server is hosted on.Would this have anything to do with

      the PSOS not working.

       

      Thanks in advance for any help.

       

      Cheers,

      Seetha

        • 1. Re: Perform Script on server not Working
          CarlSchwarz

          In your file do you have a "OnFirstWindowOpen" script trigger?  When PSOS is called it will behave as if a new client is established and will call your script triggers.  If that script is failing then PSOS is falling out before it gets to your script.

          Also you could try looking at the server logs.

          • 2. Re: Perform Script on server not Working
            sivagurS

            Thanks for the response.

             

            No I dont have any 'FirstWindowOpen' script trigger. The PSOS is even failing to reach my sub script. Not even a

            Show custom Dialog would work.

             

            I am completelt clueless.

            Any help is greatly appreciated.

             

            If anyone could recommend a sample,that would be great.

             

            Thanks

            • 3. Re: Perform Script on server not Working
              wimdecorte

              what version of FMP and FMS?

               

              If your FMP is still at 13 then you are working with 32-bit DSN and ODBC drivers whereas FMS is 64-bit and expects 64-bit DNSs and ODBC drivers...

              • 4. Re: Perform Script on server not Working
                sivagurS

                I am running on FM Pro Advanced 14 and FMS 14.

                So don't think that could be an issue.

                 

                Both the current script and the subscript are in the same FM database.

                Could that be the issue.

                • 5. Re: Perform Script on server not Working
                  CarlSchwarz

                  Where are you trying to show the custom dialogue? PSOS will not show a custom dialogue.  The script is 100% performed on the server so it will not do anything on your client like showing a custom dialogue.

                  Have you tried editing your PSOS script with the setting on to just show script steps compatible with "Server"?

                  • 6. Re: Perform Script on server not Working
                    sivagurS

                    hi..

                     

                    yeah just realized that.

                    please find below my subscript steps

                     

                    Allow User abort[off]

                    Set error Capture[On]

                    Execute SQL[]

                    Perform Find[Restore]

                    if

                    Go to layout[Layout A]

                    else

                    Go To Layout[Layout B]

                    End If

                     

                    Refresh window[Flush Cached External Data]

                     

                    I'm not sure if the PSOS step reaches the subscript

                    • 7. Re: Perform Script on server not Working
                      sivagurS

                      In Filemaker Server Log it shows scripting Error 645

                      Schedule"ReceiveUpdateWO - Admin %1" scripting error(508) at First:ReceiveUpadteWO: PerformFind"

                      Schedule"ReceiveUpdateWO - Admin %1" scripting error(1408) at First:ReceiveUpadteWO: Execute SQL"

                       

                      I looked up the FM server log Error Codes for 508 and found the below description.

                       

                      508ErrorAnother copy of FileMaker Server (%1) is already running with this license. This copy of FileMaker Server will not open any databases, but will allow updating the license key or configuring for standby server.

                       

                      I couldn't find Error Code 1408.

                      • 8. Re: Perform Script on server not Working
                        CarlSchwarz

                        Does the Execute SQL statement require you to be on a particular layout?  If it does then I would put a "Go to layout" step first...  Otherwise to debug create a new table called logging and insert this into your script at places you want to log:

                        set variable $error  get(last error)

                        go to layout(logging)

                        new record/request

                        set field Log "The server script is up to here.  Error is " & $error

                        go to layout(......)

                        And then you can debug PSOS is doing

                        • 9. Re: Perform Script on server not Working
                          sivagurS

                          Thank you so much.

                          I am now able to perform Execute SQL from the server..

                          looks like the ODBC client was not compatible, once I changed that it worked.