Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can't get the BE_ListFilesInFolder to work with Server Scheduled Script

Featured Replies

"This is the first time I'm setting up a script to run on a server with the help of a schedule, so I will probably make a lot of strange mistakes, but how hard can it be? 
Hard, obviously. :|"

I have a script that check for new files in a folder, process them, export some data and move the files to a new destination. It works flawless with the Filemaker Client. 
On the Server I can't get it to work! I'm using the BE_ListFilesInFolder step.

The folder that I want to check is the following (the FMServer User have both read and write privileges on all mentioned folders): 

C:\FTP\FM\In\

This is outside the server Documents folder, so just to be sure I tried to change it to: 

C:\Program Files\FileMaker\FileMaker Server\Data\Documents\In\

I get the same error on both. 

 

I have tried to use a field as the path as well as hardcoded as well as variables in different combinations: 

BE_ListFilesInFolder ( System::FMIn Folder ) 

BE_ListFilesInFolder ( "C:\Program Files\FileMaker\FileMaker Server\Data\Documents\In" ) 

Set variable($folderpath) and then BE_ListFilesInFolder($folderpath)

Same error. 

 

I have tried a zillion different ways. With the Client it works. From the server it does not. I GET CRAZY!!!

What have I missed? :(

...or should I just skip the Filemaker Server Schedule and do this with a client instead?

Tia, 
/Andreas

[Windows 2012 r2, FM Server v15.0.1.137] 
 

I'm using 

Let(_path = Substitute(Get(DocumentsPath);"/";"\\") & "Manifest_Detail_Imports\\";
Right(_path;Length(_path)-1)
)

then BE_ListFilesInFolder ( $_import_directory;"csv" ) to list the contents of the directory

to read the contents of \Documents\Manifest_Detail_Imports on my server 

Screen Shot 2016-10-05 at 17.00.23.png

 

doing it server-side is massively faster and less troublesome than using a client to run imports.

Edited by _ian

3 hours ago, carlsson said:

 

I have tried to use a field as the path as well as hardcoded as well as variables in different combinations: 

BE_ListFilesInFolder ( System::FMIn Folder ) 

BE_ListFilesInFolder ( "C:\Program Files\FileMaker\FileMaker Server\Data\Documents\In" ) 

Set variable($folderpath) and then BE_ListFilesInFolder($folderpath)

Same error. 

 

 

What is the error you are getting?

  • Author

Thanks for the example Ian, I will look into this soon.

I agree about doing it on the server side, it feels better as well. That's why I'm struggling with it... 😝

Wim; I got some different errors. 3 and 113 if I remember correctly. Now I only get a "?" as a result from the BE command. However, doing it from the client side (on the same server) gives no such error. And the plugin IS installed.

3 = an unsupported script step. That should be easy to identify by looking at your involved scripts with the 'server compatibility' view turned on.  Remember that server-side scripts also run the OnOpen script first, and look out for any triggers on layouts and records that you may have going on.

113 = function is missing, probably goes hand in hand with the below

? = the plugin is either not installed or not enabled.  This too is easy enough to troubleshoot by using the Get(InstalledPlugins) function at the beginning of your script and log the results.

In general: since you can't use script debugger for server-side scripts while they execute you need to beef up your error trapping and overall progress.  Log every step of the way so that you can narrow down where you have an issue.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.