13 Replies Latest reply on May 13, 2013 8:30 AM by philmodjunk

    PDF and Email Script Issue

    productionQC

      Title

      PDF and Email Script Issue

      Post

           Hello-

           I have a database running on a server via FMPS 12.  The database has been created and edited on my PC running FMPA 12 on windows 7.  The script works perfect.  However, when another user performs the same script, it crashes the program.  I have tried it on another windows 7 machine running FMP 12 and yet again on another machine running FMP 12 on XP.  If a user tries this script on any other machine, it crashes FMP and you must restart the program.  It appears to crash right at the point the PDF was being created, perhaps a path issue???  Just can't figure out why it works on my machine using FMPA 12 and Win7.  Please see the screen capture of my script below...

           Thank you,

            

      Capture.JPG

        • 1. Re: PDF and Email Script Issue
          philmodjunk

               Make sure that all computers are updated to 12.04. One of the listed fixes addresses crash that can occur on xp systems when saving as PDF.

          • 2. Re: PDF and Email Script Issue
            productionQC

                 Hi Phil:

                 I checked all machines as we just did an update...All PC's are running 12.0V4 and the server is 12.0.4.405.  Plus the same problem happens on Win 7 machine running FMP.  I am the only one running FMPA and the only one working at the moment...

                 So either the problem is not fixed, or I am doing something wrong...I just can't seem to make it work on any other machine...

                 Thanks

            • 3. Re: PDF and Email Script Issue
              productionQC

                   Don't know if this helps, but when I run the script on any of the other PC's it takes three times longer while it tries to generate the PDF.  On my PC it is for the most part "instant".  But the other two are taking about 30-40 seconds then crashing.  The first time I ran the script on mine it crashed, I restarted and tried again and since then perfect.  Followed the same protocol on all other PC's and it still crashed... YIKES

                    

                    

                    

              • 4. Re: PDF and Email Script Issue
                sparrow_design

                      

                     Hello...It looks like your Script may leave an extra window Open by mistake if Find does return Error?
                      
                     Try this on your export variable...
                      
                     Substitute ( $exportPath ; "file:" ; 
                      
                     Let (  
                     $_os = Abs ( Get ( SystemPlatform )
                     ) ;
                      
                     Case ( $_os = 1 ; "filemac:" ; "filewin:" )
                      
                     )  // end Let
                      
                     ) // end Substitute
                      
                      
                     OR try saving the File to "DOCUMENTS" Path instead of "DESKTOP"...it may have to do with applicaiton-user-write-priviledges on PC machines?
                      
                     OR try saving Layout/Record as PDF Manually from other PC Machine to verify it CAN be done at all...if successful..Edit/Replace the Save As Script steps from that machine to see if that helps everywhere else?
                      
                     HTH,
                      
                     -David
                • 5. Re: PDF and Email Script Issue
                  productionQC

                       Hi David - Leaving for the day and will pick this up in the morning, thank you for the ideas,  will try soon and update you...thx

                  • 6. Re: PDF and Email Script Issue
                    productionQC

                         Hi David-  am I entering the "substitute" in the the value section of the Set Variable command line or in the body after the the Set Variable command...Thanks

                          

                    • 7. Re: PDF and Email Script Issue
                      philmodjunk

                           Crashes can damage your file. I'd run a recover on the file to see if any issues are found and fixed during the recover and then I'd check the recovered copy out with the other computers as a test even if the recovery process does not report finding an issue.

                           Things to keep in mind about Recover:

                           While Recover almost always detects and fully corrects any problems with your file...

                             
                      1.           The recovered copy may behave differently even if recover reports "no problems found".
                      2.      
                      3.           Recover does not detect all problems
                      4.      
                      5.           Recover doesn't always fix all problems correctly
                      6.      
                      7.           Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.

                            

                           And here's a knowledgebase article that you may find useful: What to do when your file is corrupt (KB5421).

                      • 8. Re: PDF and Email Script Issue
                        productionQC

                             Hi Phil-

                             I ran the recovery and there were no problems found.  I then ran the recovery file on my local machine and when the email pdf script runs the system crashes.  The copy on the server crashes when you first run the script.  The second time it works, but save a messed up version of the PDF.  If I run the print scritpt rather than the email, it sets the page size, I cancel the print, then click the email script and it works, saving the PDF with the correct dimesnions and drips it in an email.  I got a second win 7 machine, running FMP 12.0v4 to work this way, but the XP machine is a no-go no matter what we do. Do you perhaps agree with David's change mentioned earlier and if so where am I intended to enter the "Substitute" function...?  

                             The error report I get is this:

                              

                        Problem signature:

                               Problem Event Name:                        APPCRASH

                               Application Name:                             FileMaker Pro Advanced.exe

                               Application Version:                           12.0.4.403

                               Application Timestamp:                     514b6292

                               Fault Module Name:                          DLI_PDFL91.dll

                               Fault Module Version:                        9.1.0.34

                               Fault Module Timestamp:                  511be421

                               Exception Code:                                  c0000005

                               Exception Offset:                                0008b88c

                               OS Version:                                          6.1.7601.2.1.0.256.48

                               Locale ID:                                             1033

                               Additional Information 1:                  0a9e

                               Additional Information 2:                  0a9e372d3b4ad19135b953a78882e789

                               Additional Information 3:                  0a9e

                               Additional Information 4:  0a9e372d3b4ad19135b953a78882e789

                        • 9. Re: PDF and Email Script Issue
                          sparrow_design

                               Hello,

                               I do not believe the Substitute will help-but you can add the code to a 2nd Set Variable Line setting the SAME variable as line above $exportPath.

                               My recommendation: Try doing manual SaveAsPDF to Desktop and Elsewhere on local machine before running any Scripts. If it works, use that machine and write a new 'mini' script that only does the 2-3 steps involved in actually SAVING the PDF to Dektop or wherever - test the mini Script from that machine. If it works, THEN, modify your original Script to use the new mini Script instead of original Lines, test again. IF still crashing, rewrite entire Script from the local machine, and retest from everywhere. IF still crahing, send the file to FMI Tech Support - uncheck ALL Scripts except the one in question, and you can save the file as Clone as long as it doesn't mess up the Script in question, they will examine it for free when stuff like this is happening.

                               -David

                                

                          • 10. Re: PDF and Email Script Issue
                            productionQC

                                 David - Thank you for your response.   I will proceed as mentioned and will update after all aforementioned testing is done..

                                  

                                 Thanks again...

                                  

                            • 11. Re: PDF and Email Script Issue
                              productionQC

                                   Ok, I went to the layout containing the form.  I placed a simple button on the form and set it to "Save Records as PDF".  Returned to browse mode and it worked, but the form was on two pages, looks like a portrait printed on landscape and the bottom portion is cut off and moved to second page.  Closed, reopened database (running on FMPS), navigated to layout with form, pressed button, crash!!! Same as with all scripts above.  Restarted again, tried my "print form" script that sets the page setup to portrait and canceled the print.  Went to layout with form and pressed save as PDF button and worked perfect, portrait, all on one page.  Closed database and reopened again, performed same task again, CRASH!!!.  I have no idea why, this smells like a bug...any ideas...is there something in my form that could throw it off...LOST!   

                                   Facts:  In no specific order -

                                                1)  Only way to generate PDF in portrait is to run "print setup" in alternative script.  Defaults to landscape and chops bottom 8.5x11 and dumps on page 2.
                                                2)  Save as PDF crashes every time no matter the storage location (desktop, documents, blah blah blah)
                                                3) Prior to setting up simple button, any script change and then execute would crash.  Must let it crash and then sometimes on restart it works.
                                                4) When it does decide to work, works several times, then crashes.  Can duplicate problem on all win7 machines.  Can not get to run at all on XP machines.  
                                                5) When I log in using xp users name/password on my win7 machine, providing things are in a good mood, everything works.  So XP is a no go. 
                                                6)  All users (except me) have been updated and are currently running FMP 12.0V4, I am using FMPA 12.0V4.

                                    

                                   See attached for error...

                                    

                              • 12. Re: PDF and Email Script Issue
                                productionQC

                                     Hello - Has anyone got a suggestion for dealing with this...Should I move this over to the "Report and Issue" forum?  Has anyone had any of these problems currently?

                                      

                                     Anything...

                                      

                                     Thanks

                                      

                                • 13. Re: PDF and Email Script Issue
                                  philmodjunk

                                       You may have done some of these and some may only apply to a different OS than you have, but check over this list for ideas on anything you haven't yet investigated:

                                       Figuring out why FileMaker is crashing can require some sleuthing to rule out possible issues.

                                       Basic diagnostic tests to perform when you get frequent crashes or “hangs”:

                                       Does the crash only occur with a specific file?
                                       Test by creating a small sample file and see if opening it and working with it also generates a crash. If it crashes too, the problem likely lies with the computer or it's installation of FileMaker. If it does not crash, it becomes more likely that there is a problem with the file.

                                       To check for possible problems on a specific computer, you may want to run a utility to check out the hard drive and also to check out the user accounts on that computer for possible problems.

                                       To rule out some other issues with your specific computer on Windows systems,

                                       Select Run from the start menu and type in:

                                       msconfig

                                       Then, under the Services tab, you can stop all non-Microsoft services. If this solves the issue, then you need to look at what services you stopped and see which is one is the culprit.

                                       What is reported when you recover the file?
                                       The file could be damaged. Not only can file damage cause crashes, but the crashes (or forced quits after a "hang") can damage your file. You may need to test a recovered copy to see if it works without crashing.

                                       Things to keep in mind about Recover:

                                         
                                  1.           Recover does not detect all problems
                                  2.      
                                  3.           Recover doesn't always fix all problems correctly
                                  4.      
                                  5.           Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.


                                       Does it always crash when you are doing the same thing with your file?
                                       That may point to a specific layout, script, operation that interacts with your Operating system or other applications...