I am working on an inherited system. It was originally just a single file. I split it into the separation model by duplicating the interface file to create a data file and then repointing all the interface file TOs to the tables in the data file.
The External Data Source is called DATA.
It contains the path $$PATH.DATA
Within File Options, the interface file is set to open on a temporary layout built from a table occurrence that has no relationships and no records
From here I then set a value into $$PATH.DATA before heading to a layout that references data from this file.
https://community.filemaker.com/docs/DOC-8174
This is the default method for using Dynamic Data Sources:
"We want to make sure all the actions that need to happen before we set the data source variable will happen on a layout based on this table. In other words, do not access anything that uses the dynamic data source before setting the variable. Otherwise the user will get an error message saying data source can not be found."
I have used this method successfully many times on files I have built from scratch.
When I open the interface file I get the classic error:
“The file $$PATH.DATA could not be opened. (Not Found)”
It then asks me to locate the file.
If I open the interface with the Script Debugger open, I get the same error message and it appears before the file is visible, or the opening layout, and there is no script running in the debugger - the OnFirstWindowOpen trigger has not fired.
If I click OK to the error message and Cancel when it asks me to find the file, then the interface file becomes visible, showing the opening blank layout and the script debugger then starts to run the first line of the OnFirstWindowOpen script
It is as if something tries to access the DATA file from the very beginning.
I have confirmed that the layout that the interface file opens on is built on a TO that doesn’t have any relationships or records
The only object on the layout is a single piece of text.
I’ve used FMPerception to clarify references to the DATA file. It is referenced in 220 odd TOs and a couple of scripts steps. But when the file opens the TOs haven’t been accessed and the script steps haven’t been run.
I have tried many things that have not worked.
Three things, however, have successfully avoided the error:
1) using a hardcoded path to the file - inconvenient given what I am trying to achieve
2) deleting all the interface file TOs that reference the DATA file - everything breaks
3) deleting the interface file External Data Source DATA - everything breaks
Any help would be greatly appreciated