There's a known issue with PSoS and referring to data in other files. The client must first have each file in question open before performing the PSoS.
For More Information see: Remaining issue in FileMaker Server 13.0v2 with Perform Script on Server in multi-file solutions
This is one of many acknowledged bugs that can be found in the Known Bug List thread here in the Report an Issue section of the forum.
It can also be downloaded as a database file from: https://www.dropbox.com/s/jt09b82i0xijbu3/FMP%20Bugs.zip
Oh wow. Good to know. I thought I was going crazy. The link mentions doing a go to layout script step to workaround. I could not seem to get the work around to work. I attempted to insert a "Go To Layout" step in both the Client Side script and the Server Side script to no luck. Is there something I am missing? Thanks for the help.
Additionally, I attempted doing an "Open File" of both EDS's Client to no avail.
The files have to be opened client side. Open File might be used or if you have a layout that contains fields from table occurrences based on the EDS, go to layout client side, before you start this script server side, should also open the files.
You might check and make sure that all needed files are being opened.
Gr. Yeah. From startup to this script both EDS's are referenced. I have a login/logout report that I know of off the top of my head that uses data from both EDS's.
I tried a GoTo Layout and setting a variable from the EDS.(For each EDS - Within script prior to calling the PSoS script.)
Also, I tried doing "Open File" within script prior to calling PSoS script.
I step through the script and I see both EDS's open but the resulting script still does not recognize the relationship in the EDS.
PSOS's are a different breed and there are a number of ways that a script set up for PSOS can fail. It might have nothing to do with the issue I provided info on.
Error code 3 means "Command is unavailable (for example, wrong operating system, wrong mode, etc.)"
so it could be that you are using a script step that is not compatible when executed "server side". There's a compatibility drop down in the script editor that you can use to check the steps of your script for server side compatibility.
Yeah, it's the error 100 shenanigans that you were talking about. I still can't get around it though. I have tried opening both data files locally by doing Open File immediately before the PSoS is run. I've tried going to a layout for each of the files, as well. I even tried opening a layout that has a EDS1 to EDS2 relationship. I tested the following:
(Here is where I tested the Open File and go to layout script)
Perform Script on Server [Wait for completion; "test" from "Test Data"]
Test Data Script (On EDS1)
Go To Layout ["@ Employees" (@ Employees)] //Employees table is on EDS2 and is added in the relational view.
Enter Find Mode
Set Field [@Employee::id; 1234]
Exit Script [Result:1]
On this, I get an error 100 while running the PSoS.
Both EDS's are password protected. They are on different servers at the same location. Running the exact script from EDS1 results with no errors. Any help would be greatly appreciated.
After many years of testing, I have found that ServerDB1 can have an EDS of ServerDB2 as long as ServerDB2 is on the same server. No amount of finaggling that I tried allowed PSoS to work when ServerDB2 was an EDS for ServerDB1. I simply changed the location of the EDS2 and it worked flawlessly. Where's the best place to submit this bug?
Report an Issue is for Bug reports, but please note that you have still not posted the script as I requested. You posted the client side script and I wanted to see the server side script so that I could look it over for issues. If you go ahead and post an issue report, it would be helpful to also post both your data model and the server side script so that the TS people have a more complete understanding of the issue.
I have struggled with the same problems for a while now and it is driving me nuts. The situation:
- 2 files, one containing the data (A) another with the interface (B, with scripts and layouts).
- B is connected to A (in other words, A is an External Data Source, EDS) for B.
- A and B reside on the same FileMaker Server 13v5 on MacOSX 10.8.5
- when user opens B on the client, A is opened automatically at all times. Without opening A, the application can not run at all.
- all scripts are stored in B and use layouts in B, accessing data in A as EDS.
- file B is normally opened with Guest Access (contains only scripts and layouts and some temporary data), but user always needs to log in to A with his username/password. The client has access to A when the PSoS script is run.
Now this happens:
1. running a PSoS-script that modifies or accesses a field in A (by going to a layout that show the related field) will work OK when the client computer is on the LAN (i.e. has a fast connection to the FileMaker Server that is on the same LAN). In this case, FMS apparently 'knows' that both files are open and that information is passed to the temporary 'PSoS session' on the server.
2. running this very same script from a FileMaker Pro client over a WAN connection (internet) fails in most cases. Apparently, FMS opens file B because that's where the script resides, but fails to recognise the EDS links that the script needs, even if the script explicility access the layout containing the related fields.
My guess is that this might a timing/syncing issue between FMS and client. Running the script over a WAN using the debugger usually works, but then you run the script step by step.
Any suggestions to make this work reliably?