6 Replies Latest reply on Apr 8, 2016 8:58 AM by bgustin

    Server Scipt Issue

    bgustin

      I am issue an intermittent issue with one of my server scripts.  I am running FM server 13. It runs every night at 11pm, and totals up our daily sales, then should send an email to a couple of managers with the sales total in the body of the email.  3-4 times a month this email doesn't go though.  I have set the server to send me an email every time the script is run, and I get this email every day stating that the script was successfully run but some random days I don't get the sales total email (even though I know there were records created that day).  Any idea where I should start?

       

        • 1. Re: Server Scipt Issue
          Mike_Mitchell

          The first, most obvious answer I could give is that no records are found in those cases. If no records are found, based on your script, no email is sent.

          • 2. Re: Server Scipt Issue
            bgustin

            Already thought of that, it happened on days I know we had 30-40 new records created.  I only get one email on the weekends when we are closed (no new records).  We have had been having occasional internet outages lately, but would imagine I wouldn't receive any of the emails if the internet was down.

            • 3. Re: Server Scipt Issue
              Mike_Mitchell

              Have you checked the server logs?

               

              Also, you're checking a field for the presence of records, but that field isn't set by the script. How is it set? Have you tried using Get ( FoundCount ) instead?

               

              In any event, I suggest reconfiguring the script to send mail regardless of whether it finds records or not. You can send a different message or send it just to yourself, but you'll eliminate the question. Plus, you'll have confirmation that the script is working.

              • 4. Re: Server Scipt Issue
                bgustin

                Thanks mike I will have to try and reconfigure the script a bit to always send a email to me, but if there is a found set it will send an email with the results to everyone (including myself) .

                • 5. Re: Server Scipt Issue
                  DavidJondreau

                  What is this INVOICE::found field? Seems like Get ( FoundCount ) would be a better option. Have you noticed other issues, like reports having *too many* records? Sometimes when a find fails, it returns the last found set or even all the records. I can't remember the situation when that happens, but I've seen it.

                   

                  Add some error checking. After the perform find, look for an error. After the Send Mail, capture errors. Me, I'd bcc myself on the Send Mail and add a second Send Mail after that that includes developer info such as timestamp, script name, errors captured, etc. (you could set up developer notice table instead).

                  • 6. Re: Server Scipt Issue
                    bgustin

                    INVOICE::found is a an old calculation field that I put into my original system before I know what Get(FoundCount) was.  I just added a Else statement to send me another email when there are no records, and it fixed my issue.  I probably should take a FMP Developer class, my VTC training discs from FM8 is starting to get old considering we currently are running FMP13 now. 2016-04-08_1056.png.  Thanks David and Mike for the help.