Jump to content
Sign in to follow this  
gczychi

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

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By naio
      I have FMS17 running a system shell script that does the following:
      Tar the latest backup folder and leave it into a specific 'tar' folder Mount an external volume share rsync external share and tar folder The script was running twice a day without any problem until last week when I upgraded the server OS from High Sierra to Catalina.
      FMS event log just shows the following:
      Schedule "schedule-name" aborted; aborted by user. Possibly it's a problem with permissions but how to fix it?
    • By gczychi
      Browsing through my event logs, I am finding weird scripting errors, like:
      ... Information 645 ...local Schedule "Import Main (every minute 8-20)" scripting error (401) at "Import : Import Main : 36 : Perform Find". How can a simple «Perform Find» script step (which works just fine in the server scheduled script, btw.) generate a scripting error? Occasions where the FoundSet = 0 should be considered «normal».
      I also have found other errors, that shouldn't be errors, like «Go to Record/Request/Page [ Next ; Exit after last ]», when there is no next Record.
      What is the best way to prevent this? It’s clogging the log files.
      Thanks a lot for any insight!
      Gary
       
    • By Koonce
      I have an export script and it tries to save to server i need it to save to the local desktop cannot get scrip to work... I know Im doing wrong... need help thanks in advance.
       
    • By carlsson
      Today I updated FM Server from 17.02 to 17.05. After this update WebDirect refuses to start. 
      When I click on the slider, it says "Enabled",  but when I go back again it's Disabled.
      I have looked for Java updates, but I already have the latest update applied. 
       
      I'm on macOS 10.13.6 with all security patches applied.
      I haven't installed SSL yet, but it worked before this update so....
      Where should I look more?
       
      Please help! 😩


    • By Nuos
      Hey Folks
      Im running Server 17 and have a number of scripts configured to run. Recently, some have stopped executing.  What I mean is I select it to run (or the server runs it as scheduled) and then when I run it manually, there are records that have not been processed. So I checked logs  log. "Last Scripting Error (802)"
      Any recommendations how to resolve this?
       

×
×
  • Create New...

Important Information

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