Put a Select Window step in getween the GTRR and Show/Hide steps. Select the newly opened window in that step to make sure that it has the focus before hiding/locking the status tool bar.
I had simplified the script. This is the full script I have, an it still doesn't hide the toolbar. Like I said, this hides it if related record is in a different table within same file, but does not hide if it is related record from a different file. Using FMPA 12 by the way.
Script goes like this:
Set Variable [$windowname, Value: ....]
Select Window [$windowname]
Show/Hide Toolbars [lock; hide]
Adjust window [resize to fit]
What you show has always worked for me.
Does the GTRR step correctly use $WindowName to name the new window?
Yes it does, at least i think it does.
Two files are connected by serial number. There is a file for Purchase Orders, another for Product Catalog
Set Variable takes value of serial number from line item (in a portal) from Purcahse Orders.
GTRR goes to that related record from Product Catalog, and names the window the set serial number.
I suggest posting the actual script that you are using.
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 click "Source" in the Post A Answer tool bar to paste the text into the forum's HTML editor.)
Thanks for the tip. Below is the script pasted from design report ->Script Pretty.
Previous Script: [Go To Contacts] Parent Folder: [Navigation]
Script Name Go to Related Product
Run script with full access privileges On
Include In Menu No
Layouts that use this script •
Scripts that use this script •
Script Steps • Set Variable [ $windowname; Value:"AR & AR - " & Product Catalog::Serial Number ]
• Go to Related Record [ From table: “Product Catalog”; External; Using layout: “Form View” (Product Catalog) ] [ Show only related records; New window ]
• Select Window [ Name: $windowname ]
• Show/Hide Toolbars [ Lock; Hide ]
• Adjust Window [ Resize to Fit ]
Fields used in this script • Product Catalog::Serial Number
Scripts used in this script •
Layouts used in this script • Form View
Tables used in this script •
Table occurrences used by this script •
Custom Functions used by this script •
Custom menu set used by this script •
In the script step: Go to Related Record [ ... etc
Are you setting the window name?
That's been my thought from the first. Inside the Go To Related Records step, $windowname should be used to specify the window name. If it is not or if you accidentally misspelled that variable name by even one letter, it would explain why this script is failing to hide/lock the status tool bar.
You can use Upload an Image below the Post A Answer box to upload a screen shot directly to your forum post instead of linking to a share site.
I just thought of another possible explanation.
Open up the Select Window Script step.
By any chance is the "current file only" check box selected?
If so, you need to clear that check box.
It is unchecked. I will try to insert image directly.
What version of FileMaker and on what operating system are you using it?
Is it possible that you have more than one window open with this name?
If you have FileMaker Advanced, try stepping through this script in the script debugger and see if you note anything odd like another script popping up and running courtesy of a script trigger "tripped" by your script.
I'm running FMP Advanced 12.0v3 on OS X 10.8 . Users are running FMP 12, on Windows 7 and OSX 10.8. Everything is running off of FM Server 12 on a mac server OS X 10.7. Every user sees this issue.
I just ran the script debugger, where you can run each step of the script invididually. No other scripts were triggered. Interesting to note is that Adjust Window [Resize to Fit] doesn't work either.
No other window with the same name is open.