5 Replies Latest reply on Dec 31, 2013 12:06 PM by mikebeargie

    FM12 Export to PDF, create email on Windows locks user in email window

    flybynight

      OK, so I have a little modal window for my users to attach a PO to a job ticket. They enter the vendor from a drop-down, date needed, add some notes etc. Then they can Print, save a PDF to their desktop, email a PDF or close that window to get back to their job ticket.

       

      Of course, everything works perfectly for my Mac users. For my Windows users, there is a problem: if they email the PDF, it puts them in a window in Outlook with the email with the PDF attached, and FileMaker Pro is in the background. However, they can't do anything besides that email. Quite often, they will want to navigate to a different email to grab additional attachments (a mailing list for example), so also attach with the PO. But they can't get to their inbox, or any other Outlook window until they have closed or sent that email with the PO PDF. They also can't get to their desktop to grab a file from Windows Explorer. Many of my PC users have relatively small monitors, so many of them run FMP maximized.

       

      As a work-around, they can save the PDF to the desktop and attach that, of course.

       

      Is this expected behavior?

      On the Mac, the create email PDF attachment works just fine and the user isn't locked into that 1 email window. It seems that on the Mac, it creates the email and then continues the script in the background, which retruns the user to the PO edit layout (as opposed to the PO Print layout to make the PDF). On windows, I can see that the script does not finish until the user either closes or sends the email.

       

      Is this because I'm starting from a Modal Window? Or does the create email attachment option on Windows just naturally leave the user stuck in the email window?

       

      I think my script for this is pretty simple:

      Screen shot 2013-12-31 at 10.54.52 AM.png

       

      Thanks for any insight or better work-arounds!

      -Shawn

        • 1. Re: FM12 Export to PDF, create email on Windows locks user in email window
          mikebeargie

          The documentation covers a little on the OS differences, but not specifically this issue:

          http://www.filemaker.com/12help/html/non_toc.46.53.html

           

          I never really trusted the advanced windows settings for WinOS, and usually script around it based on Get(SystemPlatform) of -2 for windows, or Get(SystemVersion).

           

          Does it work as expected when the window is NOT modal?

           

          I am assuming FM is treating the Send Email script step as not completed until the send button is pressed in the email client. See what happens in script debugger to confirm that.

           

          You might correct the action by performing your next window action BEFORE your send mail script step for windows.

          • 2. Re: FM12 Export to PDF, create email on Windows locks user in email window
            flybynight

            Mike Beargie wrote:

            I never really trusted the advanced windows settings for WinOS, and usually script around it based on Get(SystemPlatform) of -2 for windows, or Get(SystemVersion).

             

            So, what do you do instead when you want modal window behavior. In this case, I don't want the user to be able to do anything else until they have dealt with and finished (or closed for later editing) their PO. I don't want them to lose context, or be able to have a stray window(s) open behind the main one if they just click back instead of closing. This sort of thing seemed easier and more efficient than actually going to a different layout and then going back. The PO data entry layout is very simple, but the main Job Ticket window is more complex with a couple of tabs and portals.

            Maybe once we go to FM13, this could be a PopOver, but still not sure if it would solve this issue.

             

            Mike Beargie wrote:

            Does it work as expected when the window is NOT modal?

             

            I am assuming FM is treating the Send Email script step as not completed until the send button is pressed in the email client. See what happens in script debugger to confirm that.

            I did test with the window not being modal. The behavior is the same. Still leaves the user stranded in the email window. I tried clicking through the Windows task bar to bring the Outlook inbox to the front, but it just snaps back to only FileMaker showing in the background, and the composed email window on top of that.

             

            I don't have Advanced installed on a Windows machine to test with Script Debugger. But, I did test with the Freeze Window script step disabled, and then when the user is in the email, I can see that the FMP window is showing the PO Print layout (the layout where it makes the PDF), so I can only assume that it has not gone on to the next step, which puts the user back on the PO data entry layout.

             

            Mike Beargie wrote:

             

            You might correct the action by performing your next window action BEFORE your send mail script step for windows.

            I guess I don't understand how I would accomplish that. The email is created as an option in the Save Records as PDF script step. I then let the user enter the recipient email address, subject, other notes, etc. FMP isn't actually sending the email, just creating it for the user with a PDF of the PO attached.

            Would I do this with the Send Mail script step instead?

            Looks like that would give me more options than the Save Records as PDF with the email option. That just might be the fix. Off to experiment!

             

            Thanks!

            -Shawn

            • 3. Re: FM12 Export to PDF, create email on Windows locks user in email window
              mikebeargie

              Maybe try creating your PDF to a temporary location path, then use the send mail script step?

               

              If you're creating an attachment with the generated email, then the behavior could be different because of that.

               

              Try:

              Set Variable $path = "file:" & get(temporary path) & "filename.pdf"

              Save Records as PDF (to $path)

              Send Email (specify $path as the attachment).

               

              See if that results in different/corrected behavior.

              1 of 1 people found this helpful
              • 4. Re: FM12 Export to PDF, create email on Windows locks user in email window
                flybynight

                Was just experimenting with that… I get slightly different behavior, in that I have more control over the email (I can specify the address, subject, body text, etc).

                 

                But, on Windows, I still get the user stuck in their composed email window for review, unable to get at their inbox.

                 

                For now, I think I'll just have to tell my users that if they need to attach other stuff from their inbox to the same email, they will have to save the PO as a PDF to their desktop instead of using the "EMAIL PO" button.

                 

                At least the method with the Send Mail script step gives more control.

                 

                Thanks for your input!

                -Shawn

                • 5. Re: FM12 Export to PDF, create email on Windows locks user in email window
                  mikebeargie

                  Any chance they can save the email as a draft and bypass it?

                   

                  It definitely sounds like a windows issue. Hopefully you'll create a method that's acceptable, but it sounds like an issue that is being created by going outside of filemaker, not an issue really with filemaker itself.

                   

                  IE it sounds like there's some sort of hook that's left in windows when outlook is launched that doesn't exist in macOS.

                   

                  Good luck!