Most likely, it's executing a script where the reference is incorrectly defined. Check the OnFirstWindowOpen trigger. See what script is running. There's probably an external script being executed that's pointed to a deleted external source. Point it back to the correct source and it should fix the problem.
Thanks Mike. I had the debugger open prior to opening the file and the prompt comes up before the script even begins to run. It's FMP11 so there's only OnOpen.
Then check the Relationships Graph. There's probably a TO on the graph that points to a deleted External Source.
Yup, did that too. After opening and pointing to the correct file, the manage database opens fine, and i opened up every single TO and ensured it was pointed to the file that I picked when opening. None of them had 'data source missing'. Then closed the file and on opening again it can't find the file.
What about a trigger on a layout?
Or maybe a calculation field that's being displayed on a layout?
Did you run a DDR and search for ""?
I note that your data source includes the file format ".fp7" in the file name.
Is this being run in FMP11 or older, or has it been converted?
Either way, try editing out the ".fp7" from the file reference and see if that makes a difference. I have seen this problem with runtimes using a different extension than fp7, and found that no extension was necessary for the filepath to work. Also check for any extra or missing "/"s in the filepath(s).
Also, check that no single target file is referenced with different filepaths from the same file. If there are mutliple data references to a single file, consolidate them by editing the TOs to use a common data source.
Pretty sure I checked for triggers on layout but will double check - again though, this 'missing file' dialog pops up before any scripts are executed. Not sure on the order in which things are done but my sense is it's a relationship based issue.
Calc field - again I'll check but the layout is just a bunch of buttons.
I did run a DDR and when I first ran it it asked for the file location - at which point I hit cancel because I wanted to see what it wouldn't reference, but nothing looked out of place. I'll run it again though in full.
It is in FMP11 yeah. I have tried with or without .fp7 in the filename, and picked the filename in manage data sources. The file is in the right place, and accessible, just every time the first file is opened it requests the location of the other file.
I did open every TO in the RG and check that it was using the right data source. And they all seemed to be.
It's a weird one. I'll get the DDR and dig through more deeply.
If, in fact, it is trying to use the external data source prior to executing any script, that means that either the closing layout or the opening layout of the file includes a field or object which draws information (possibly even via a defined calculation field) for a field or merge text object that requires data in the referenced file for it to display. That means there is a data source somewhere in the file(s) that is a problem.
It's even possible that the first file is referencing the second file via a perfectly good data reference, but the second file has a self-referencing data source defined which is failing because of something as obscure as the file itself having been renamed without the self-referencing data source having been updated.