2 Replies Latest reply on Feb 2, 2016 6:42 AM by mcemond

    Server scheduled script not completing

    mcemond

      I have a script that steps through each crew member to see if they logged any hours today. If they did not, I send them an email reminder. I have stepped through the script using the debugger and it all works fine on my Filemaker Pro...

      Go to Layout [ "crew" (crew)]

      Go to Record/ Request/ Page [ First ]

      Loop

           Set Variable [ $crewLogged; Value: crew::crewName ]

           Set Variable [ $crewEmail; Value: crew::email ]

           Go to Layout [ "logTime" ( logTime ) ]

           Enter Find Mode [ ]

           Set Field [ logTime::dateLogged; Get ( CurrentDate ) ]

           Set Field [ logTime::crewName; $crewLogged ]

           Set Error Capture [ On ]

           Perform Find [ ]

           Set Error Capture [ Off ]

           If [ Get ( FoundCount ) = 0 ]

                Send Mail [ Send via E-mail client; To: $crewEmail; CC: "somebody@else.com"; Subject: "Subject Text"; Message: "message here"]

           End If

           Go to Layout [ "crew" (crew) ]

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

      End Loop

      Go to Layout [ original layout ]

       

      I set up smtp on my filemaker server going to a gmail account. the test was successful and the server did send a test email using the account.

       

      I set up a scheduled task on the filemaker server to run the script above nightly but it did not complete giving a simple error message with no details. Can anyone give me a hint as to why it may not run? Do I need to insert pauses, thinking I'm not giving it enough time to send the email?

       

      Edit... I should mention that all the script steps appear to be valid for server compatibility.

       

      Thanks

      Mike