7 Replies Latest reply on Jun 21, 2011 11:09 AM by philmodjunk

    Snapshot Link attachment generates error

    bsheifer47

      Summary

      Snapshot Link attachment generates error

      Product

      FileMaker Server

      Version

      11.03

      Operating system version

      Windows Server 2003

      Description of the issue

      Each day I have Filemaker Server run a script from one of my solutions, that attaches a snapshot link to an email. In the loop around 40 or 50 emails go out.
      The snapshot link is exported to the FM Server Documents folder, and from the client perspective, the process works flawlessly.
      When the script runs, it generates a schedule status email to me, which reports error 101, but does not specify what the error is.

      This is obviously just a nuisance because it makes it hard to tell if there is a genuine error or not

      Steps to reproduce the problem

      At 6:45 AM Monday Morning, the problem will reproduce. It happens every weekday.
      I have a trap script that keeps the full script which attaches the .fpsl from running on Saturdays and Sundays, so on weekends the message I get is the script ran without error

      Expected result

      No error

      Actual result

      Here is a sample email I received last week. Get two a day, as two different scripts attach the .fpsl:

      FileMaker Server 11.0.3.309 on Sun Industries_FMS reported the following event:

      2011-06-13 06:45:04.552 -0700     Information     644     Sun Industries_FMS     Schedule "SST_ Action Item Followups" completed; last scripting error (101).


      Contact information not specified.

      Exact text of any error message(s) that appear

      See above actual result

      Configuration information

      The company has 4 servers, all running Windows Server 2003.

      One of the Servers hosts Terminal Services

      Filemaker Server Advanced is installed on its own server, and it is a single-machine install

      All clients and the client version on Terminal Services are updated to FMP 11.3

      Workaround

      As mentioned above it is simply a nuisance and makes it hard to determine a genuine error when the system "Cries Wolf."

      error_attachment.jpg

        • 1. Re: Snapshot Link attachment generates error
          TSGal

          Brooks Sheifer:

          Thank you for your post.

          A script error 101 means "Record is missing", so the last sentence "Contact information not specified" appears to support this.  You can find a complete list of FileMaker error codes at:

          http://www.filemaker.com/help/html/error_codes.html

          Can you post your script?  Is it possible you are referencing a record that does not exist?

          Do you have FileMaker Pro Advanced?  If so, you can move the file from the server to your local drive, step through the script and see where it fails.

          Any other information you can provide may be helpful.

          TSGal
          FileMaker, Inc.

          • 2. Re: Snapshot Link attachment generates error
            bsheifer47
            Thanks TSGal.
            All records exist and all contacts have valid email addresses and are receiving the Snapshot Link with their email.
            What is the best way to post the script? I can "Print to File" from Windows, but when I try to open in MS Word it displays a lot of formatting stuff.
            I inadvertently rated you a "Best Answer." Please excuse my being a bit new at this.
            Brooks
            • 3. Re: Snapshot Link attachment generates error
              TSGal

              Brooks Sheifer:

              You can print the script to a text file, and then open the file using Notepad (Windows Utilities), and then copy and paste into a reply.

              Since you mentioned you are looping through the records, do you move the record pointer when the loop completes, or do you leave it the end of file?

              TSGal
              FileMaker, Inc.

              • 4. Re: Snapshot Link attachment generates error
                bsheifer47

                TSGal...

                Here is one of the two scripts that generate the error. BTW, printing to the text file on Windows produced nothing but gobbledygook, but was able to access the server from a Mac, and save as a pdf.

                Brooks

                **Requests**: Email Followups: Generate email Followup (Server)

                #The Server Trap halts the script if it is Saturday or Sunday

                Perform Script [ “Server Trap: don't send system email on Saturday or Sunday” ]

                Set Error Capture [ On ]

                Go to Layout [ “Project_Edit” (Project_Edit) ]

                #Perform find returns the records where the followup date is today or before, and filters out various status types where followup date is

                a non-issue

                Perform Find [ Specified Find Requests: Find Records; Criteria: Project_Edit::FollowDate: “<=//”

                Omit Records; Criteria: Project_Edit::status_current: “Complete”

                Omit Records; Criteria: Project_Edit::status_current: “Dead”

                Omit Records; Criteria: Project_Edit::status_current: “Under”

                Omit Records; Criteria: Project_Edit::PSID: “==st46”

                Omit Records; Criteria: Project_Edit::status_current: “=” ]

                [ Restore ]

                If [ Get ( LastError ) = 401 ]

                Exit Script [ ]

                End If

                Go to Record/Request/Page

                [ First ]

                #Each loop makes a Snapshot Link of the current record, exports the file to the FM Server Documents folder, Sends mail to the contact

                designated in the file, attaching the corresponding Snapshot Link

                Loop

                Set Variable [ $link; Value:"filewin:" & Get ( DocumentsPath ) & "SunSalesDB.fpsl" ]

                Save Records as Snapshot Link [ File Name: “$link”; Current record ]

                Send Mail [ Send via SMTP Server; To: projedit_STAKEHOLDERS::Email; Subject: "Project Followup: " & Project_Edit::

                Proj_Name; Message: Let ([cd = Get ( CurrentDate ); fd = Project_Edit::FollowDate; pn = Project_Edit::Proj_Name];

                Case (fd = cd; "FOLLOWUP DUE TODAY for " & pn; fd < cd; "FOLLOWUP OVERDUE BY " & cd - fd & " DAYS for " & pn; pn

                & " HAS NO FOLLOWUP DATE" ) & "¶¶CUSTOMER; " &

                projedit_CUSTOMERS::Cust_and_City Full & "¶¶CONTACT: " & projedit_CONTACTS::c_Name_FNLN &

                "¶¶CONTACT PHONE: " & projedit_CONTACTS::Phone & " CONTACT CELL: " & projedit_CONTACTS::Cell & "¶¶LAST

                UPDATE NOTE¶" & ProjEdit_LastHistEvent::EventDate & ": " &

                ProjEdit_LastHistEvent::EventInfo) & "¶¶SPECIAL NOTE: If you have access to the Filemaker Server (i.e. you are on the Sun

                Server or TS or VPN), Open the attachment to this email and it will navigate you to the Project Record where you can easily

                update."; Attachment: “$link”; Name: "The Filemaker Pest"; Email Address: "sun_filemaker@sunindustriesinc.com"; Reply-To

                Address: "dfrederick@sunindustriesinc.com"; SMTP Server: "sundc1"; Port: 25; Authentication Type: Plain Password; User

                Name: "sun_filemaker"; Password: "********" ]

                [ No dialog ]

                Go to Record/Request/Page

                [ Next; Exit after last ]

                End Loop

                • 5. Re: Snapshot Link attachment generates error
                  philmodjunk

                  Go to record/request/page [next ; exit after last ]

                  Will log a 101 error code when it exits the loop on the last record in found set. It does not indicate (in this case) that anything went wrong with your script.

                  • 6. Re: Snapshot Link attachment generates error
                    bsheifer47

                    Thanks PhilModJunk. That makes sense because both of my scripts use the [Exit after last], and as mentioned in the original post, the script worked fine.

                    Server-generated scripts are a far-cry from client-generated.

                    I'll just put a record count in a variable and step the count on another variable. When they're the same, bye-bye script.

                    One more interesting note. Whatever FM support I found did not list the .fpsl file as one that could even be used. Makes me wonder what other file-types will work with Server-generated scripts.

                    Thanks again,

                    Brooks

                    • 7. Re: Snapshot Link attachment generates error
                      philmodjunk

                      Get ( RecordNumber ) = Get (foundcount) is one test you can use to tell that you are on the last record.