... how do I say- if "invoices" is open bring it to the front. If not open "invoices"
Hi Marco, I'm unsure what makes an invoice 'open' but here is the basic concept - You want to find all Open Invoices (assuming they have a Status = Open). Create a "Find Open Invoices" script similar to:
Go To Layout [ layout based upon your invoices ]
Enter Find Mode [ uncheck pause ]
Set Field [ your Status Field ; "Open" ]
Set Error Capture [ On ]
Perform Find [ ]
If [ Get ( LastError ) ]
Show Custom Dialog [ OK ; "No records found." ]
Go To Layout [ Original Layout ]
... you now have a found set of open invoices.
My guess would be:
Open File [ "Invoices" ]
My file name is invoices, and I was wondering how to write the script to bring the window forward if it is open (behind one of the other window) and if it is not open already then open the file called "invoices".
I am having the same issue, if I already have a window with a specific name open I would simply like to choose that window, if that window does not exist yet, I would like to create it.
I am using FMPro 11 advanced on Windows 7
I have tried a few variations of the following script without much luck
If - WindowNames ( Get ( FileName ) ) = "Employee"
Select Window [Name: "Employee"]
ElseIf - WindowNames ( Get ( FileName ) ) ≠ "Employee"
New Window [Name: "Employee"]
Any information is appreciated!
WindowNames is a return separated list of all open FileMaker windows for the specified file. Thus, WindowNames ( Get ( FileName ) )= "Employee" will only be true if "Employee" is the only window open for that file.
Try testing with the FilterValues function:
IsEmpty ( FilterValues ( WindowNames ( Get ( FileName ) ) ; "Employee" ) )
will be true if Employee is not open and false if it is.
PHIL THANK YOU!
I had a feeling I may have something to do with the fact that it may not match exactly.
I do not fully understand the FilterValues yet, but it is starting to sink in, nevertheless it works, and solves a problem I have wanted to overcome fro quite some time!
Thank you again!