Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2078 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

bcooney,

Thanks for the references to Josh's comments.

I don't think that's going to be the case because the error is occurring before the onFirstWindowOpen script has kicked in. But I'll check out the scripting in light of his comments and see whether it helps!

Thanks

Posted

Can you post the text of the OnFirstWindowOpen script? Something there is likely referencing the data source. Even though the script may not have made it to the step that does it, the script's load process can trigger FileMaker to reach out to it. Thus generating the error you see. I've rarely seen a different cause of the problem you are describing...but I also know it's possible!

If we could see that script, it may help. Also, the Table Occurrence names that reference that data source.

Posted

Also, I believe that you need to be careful of last window closed. Doesn't that load briefly before first window open?

Posted

I don’t remember. There was a behavior change in one of the last few versions. And I don't remember now. 

I saw a similar post on the Community forum that seems to have resolved the issue. Suggestion was to delete the data source and recreate it. That seems to have resolved it in this case. 

Posted (edited)

Thanks all for your input.

I've turned off both the onFirstWindowOpen and onLastWindowClose triggers and I still get the same issue.

655070809_ScreenShot2019-03-14at11_46_12.jpg.fef7b11e7aaa896e3c2a34ab51ed7bcb.jpg

 

Regarding the TOs, there are 220 TOs referencing DATA - 95% of the TOs

These are the setup details for the 'landing page' in File Options:

1585181815_ScreenShot2019-03-14at11_42_04.jpg.f857fd396f43bbc424fe1cc2905c203b.jpg

 

And the triggers in File Options:

1315100522_ScreenShot2019-03-14at12_01_18.jpg.a78f433c77744fa0e006e7ca4a0edcb7.jpg

 

Layout - only one text object:

1876159261_ScreenShot2019-03-14at11_42_23.jpg.89e580f7c62b0aa5f982c01ca89ed803.jpg

 

Layout Manager shows no script triggers:

 

650265998_ScreenShot2019-03-14at11_42_45.jpg.9bd779b532443e8b9510341c9da4a7b5.jpg

Manage Database - table that layout is built on:

963442926_ScreenShot2019-03-14at11_41_01.jpg.d32bed95118b8dbecec51a3603d591a8.jpg

 

And the data source returning the error:

1288323324_ScreenShot2019-03-14at12_02_06.jpg.d5345f4116fdd164257207fc753e6643.jpg

 

I posted the same thing on the community yesterday. TSGal replied with some things to test. Not yet resolved though!

https://community.filemaker.com/message/841847?commentID=841847&et=watches.email.thread#comment-841847

 

Thanks for all your help

 

Edited by Robin Penfold
Posted

If you turn off the "Switch to Layout", where does the file open to by default? If you unhost the file, and go to your flashscreen layout and close the file, that will become the "default".

See if the error goes away. If not, maybe you can make clone of the file and send it to me back channel, and I can see if I can figure out where the connection is trying to happen.

Posted

Josh,

Thanks for your help.

I've gone into the File Options and set 'Switch to Layout' to be blank.

I still get the same issue.

 

As another puzzle piece that I think might be related:

If I open the file and set a hard-coded path for DATA then the data is visible in the interface file as expected.

I have a script for updating fields in a Quote and its Lines. It goes to a layout built from a session record in the interface file. It then references a the Quotes table in the DATA file and then has a portal showing the related lines from the DATA file.

When I run it locally using Perform Script it works fine.

When I run it on the server using PSOS the Go To Object step that puts the focus into the portal for the lines returns error 100 (File is Missing).

Seems very very odd.

I have setup various testing scripts that confirm that the OnFirstWindowOpen script runs correctly on the server and creates the session record.

If I change the code and before the Go to Object step I test IsEmpty(session_QUO::__ID) it returns True, meaning that it can't see the table.

Doesn't really make sense.

Thanks for your offer of looking at the file. TSGal is following up on some things. I'll see how that goes. You looking at an anonymised version of the file might be great.

Thanks

 

Posted

Can you copy the text of the first script that runs and paste it here? The first thing you need to do is a Perform Script that sets that variable with the datasource path.

Posted (edited)

Josh, certainly could do that, but I've had it set to have no OnFirstWindowOpen script and I still get the error when I open the interface file directly.

Normally, I have an opener file for each client into which I set the current file names and paths for Dev, Testing and Live.

Depending on which I choose, that then calls a script in the target file which opens it. This means that the OnFirstWindowScript doesn't run and it just runs the targeted script.

 

Quote

https://fmhelp.filemaker.com/help/17/fmp/en/index.html#page/FMP_Help/onfirstwindowopen.html
 "performing a script in another file does not activate this script trigger in that file, even if the script creates the first window for that file. To have this script trigger activate in another file, open the other file using the Open File script step before performing the script in that file."

The OnFirstWindowOpen script thus only runs when I run a script using PSOS. It does Set Error Capture and Allow User Abort etc and then runs a subscript to create a session record.

Thanks

 

Edited by Robin Penfold
Posted

Not having any OnFirstWindowOpen script may be part of the problem. If the file loads all the way up, without that reference resolving, it will not work ever, until the file is closed and reopened.

Try a single-step script that just sets that variable.

Posted

Josh, thanks for your further help

I now have an OnFirstWindowOpen script that contains a single line:

Set Variable [ $$PATH.DATA ; Value: "fmnet:/###/@@@_v1_0_13" ]

 

When I open the interface file directly with the Script Debugger open I get the ‘File not Found’. At that point, the Script Debugger is blank and I can see no file or layout.

It asks for the file and I click Cancel.

It then runs the single script and leaves me on the starting layout, built from the interface file TO with no relationships or records.

 

The Data Viewer shows the correct path in $$PATH.DATA

 

I then go to a layout that contains data from that DATA.

It shows <File Missing> in each of the fields

 

The first time:

I opened the graph which seemed to refresh the reference to the file and the TOs referencing the data file showed correctly.

When I closed it, the layout then refreshed so as to show the correct data from the DATA file.

 

Another time:

I went into the graph but it didn’t refresh and just showed <File Missing> for the TOs, even though $$PATH.DATA contained a known-good value.

I then went into External Data Sources and DATA and beneath $$PATH.DATA I added the reference to the file.

I then came out and it refreshed

I then went back in and removed the hard coded reference and then the data showed correctly

I then changed the reference to $$PATH.DATA___ and it wouldn’t save saying it couldn’t find the file.

But $$PATH.DATA worked having been ‘nudged’.

 

I think there is something abnormal going on!

 

Check out the same original post on the FileMaker Community site and TSGal’s responses

https://community.filemaker.com/message/842091?commentID=842091&et=watches.email.thread#comment-842091

 

Thanks again

Posted

@Robin Penfold 

If you want to send me a link to download the file or get access to it, I’d be willing to take a peek at it. Up to you. 

Send the link via private message if you decide to. 

This topic is 2078 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.