When a file accesses another file via a relationship the database is opened by FileMaker and hidden.
So long as the file is still hidden when the main file closes, it should be closed too.
See this by checking what is listed in your Window menu under Show WIndow>
no!!! the file is actually closed!!! Residing on hard drive!!
r o b
Lyndsay is correct. If the file were closed the portal would be empty.
Ok yes!! Lyndsay is correct about the SHOW.
So what's with this Show Window though?
i launch my first of two related files and my 2nd related file is "NOT" launched YET but it is shown in the Show Window.
i know i should be refreshing my mind the details of this from FM basics!!
BUT clearly it IS NOT LAUNCHED cause my launch scripts have not activated!! And my portal is showing records ?
If the file is where FileMaker can find it and the table is in the graph, FileMaker opens it for you. That's why you see the data in the portal.
You can verify this by closing FileMaker, move the second file and the reopen
FileMaker and the primary file. FileMaker won't find the second file and the portal will be empty.
You should be able to close everything put the second file back and have everything work.
Your File's startup script won't fire until a Window is Open for that file, not just the data having been read by the application.
Back in the pre-FM7 days, these behaved differently, but the startup and shutdown scripts now fire on First Window Open and Last Window Closed for the file, unless the file is opened solely via a relationship or by calling a different internal script in that file from another file.
For instance, if you actually Open the file via the Show (Window menu), then close that file, the Closing script WILL run, but it won't run at all if the Show Window is not used and nothing else causes a window to ever open for that file.
Files opened via a relatioship will not have their OnOpen scripts run.
OK thanks everyone!! i had no problem to begin with.
i was thinking something was wrong, how i could be reading and writing data in my portal when its source / related file IS actually physical closed.
Of course it makes sense .. when two files are related and if you start up the application opening just ONLY the file with the portal, then the portals source file is opened and stays hidden (unless the relationship gets broken somehow).
Then the answer, from all what everybody says .. "HIDDEN WINDOW" means it is opened, residing in Memory !! And bottom line: you cannot ever open just one related file. Of course !!! And naturally my startup scripts will not fire until i call upon the window. Thats where i was getting getting confused. i was seeing my data in my portal BEFORE i clicked on my navigation button to go to its source file and when the source file came in view then my startup scripts got activated !!
OK !! Fine !! its answered !! i bury myself royal deep in other supreme complications of development and FORGET FM BASIC STRUCTURES !!
However on this subject, questioning FileMakers Foundation . . 'what would be wrong with FileMaker having an option, of allowing a related file to stay physically closed"!!!???
Some files could grow to be huge gigabytes and take up a lot of memory blocks. Then FileMaker could simply write the data directly onto the hard drive?
r o b
If you want to see the data in the portal, the file has to be open. If you change the data, FileMaker has to write the data back to the file. Not doing so would be like spending an hour writting a chapter for a book, then closing the window without saving the chapter. FileMaker doesn't want you to loose your data and if multiple people are using the database, they will need to see the changes you make when you make them. So in short if the file is closed... it isn't available if it's available the file is open.
Yes agree!! But let's speculate to say you had a file that was 77 gigabytes. Certainly there's no sense to OPEN this file to Read and Write if all you could do is access it through a portal if FM had a structured option for this.
r o b
The size of the file isn't at issue here. FM caches the data which is required for whatever is loaded on-screen.
That could include any or all of the portal file, depending on what relationships must resolve.
But then, the data for resolving the realtionships must be cached (read from the file) for the portal to work. When your file is properly hosted on FM Server, the server manages the caching of what is needed to the local machine. There are certainly improvements which could be made in how records are cached, but developers can also optimize caching by ofloading some fields from Wide Tables (those with lots of fields) to related tables so that fewer fields of data require caching.