Jump to content

Script Running on Server doesn’t see Records of External FM Data Source


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

Recommended Posts

FMS17: In my Import.fmp12 database, I have specified an external FileMaker database file:Main.fmp12 and added a couple of table occurrences to this file (with the same names as in Main.fmp12) and added the corresponding layouts.

When I open Import.fmp12 from a client, I can see and work with all records of the Main.fmp12 file, just fine. From the client, I can also run any script just fine.

However, when I run the same script as a scheduled script from the server (only with server compatible script steps, of course) the script runs, but I can’t see any record !

Here are some script steps that I use:

     Go to Layout [ “Kontakt” (Kontakt) ]

     Show All Records

     Set Variable [ $id_Käuferbetrieb ; Value:  Let ( [ ~fmsql_execute = True ; ~query = "  SELECT id FROM Kontakt WHERE Betriebsnummer = ?  " ; ~columnSeparator = Tab ; ~rowSeparator = ¶ ; ~result = … ]

And this is what I get:

(Import is a local table and a local layout)

LayoutName: Import

RecordCount/FoundCount: 1324/30

LastError: 0

(Kontakt is a local layout with data from a remote table of an external data source from Main.fmp12, with TO «Kontakt»)

LayoutName: Kontakt

RecordCount/FoundCount: 0/0

fmsqlresult: ?

LastError: 0

I’m puzzled — Any idea what’s wrong?

Thanks a lot for any help!

Gary

Link to comment
Share on other sites

OK, I have found the problem:

The account that I use in FMS to execute the script was not defined in both files, but only in one. Makes sense.

So, in order to be able to access data in an external data source, the same account which FMS uses to execute the script needs to be present in both files.

Link to comment
Share on other sites

This topic is 1878 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.