4 Replies Latest reply on Aug 30, 2012 10:53 AM by philmodjunk

    Print script and return to same record



      Print script and return to same record



      I have a layout in FM Pro 12 to enter my data. I then have a button to generate a printed work order. I seem to be missing a step in my script because when i go back to the original layout, it ends up on a different record. I would like to return to the record i had just printed. I know there is a way to do it, it is just escaping me how to do it.



        • 1. Re: Print script and return to same record

          We'd need to know what exactly your script does to print that work order. If the print script interacts with your layout's, table occurrence's found set of records by performing a find, omitting records, or some such, that would explain why you are not on the same record. There are several ways you can avoid such changes for the layout that's current when you run this script:

          OPen a new window, do whatever is needed with in the new window to print your work order and then close the window. Each window gets found sets that are independent of the found sets in another FileMaker window.

          Use a layout for printing your work order that is based on a different table occurrence that refers to the same data source table. Since each table occurrence get's it's own found set, sor order and current record, changes to the found set in this "print layout" will not affect the found set of your current layout.

          Save the primary key of the current record in a variable or global field. Use a loop, perform a find or use Go To Related Records to return to your original record after printing the work order.

          • 2. Re: Print script and return to same record

            Is there a way to post my current script or do I have to take a screen shot and post that?




            • 3. Re: Print script and return to same record
              /files/57fb6a9cf9/FileMaker_Pro_Advanced.png 545x337
              • 4. Re: Print script and return to same record

                Posting a screen shot is one option and works well for simple scripts.

                To post a script to the forum:

                1. You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
                2. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
                3. If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
                4. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)


                While posting the script is a good start, it may also be helpful to document the relationships and table occurrences referenced by your script and on any layouts involved.