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.
Is there a way to post my current script or do I have to take a screen shot and post that?
Posting a screen shot is one option and works well for simple scripts.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
- 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.
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- 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.