Jump to content
Server Maintenance This Week. ×

Trouble Exporting Records via Scheduled Server Script


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

Recommended Posts

I'm trying to export records from a constrained set into a CSV file.  

 

I have taken note that when exporting via a server script you have to export to the Documents folder on the server (or a temporary folder) so I use get(DocumentsPath) & "filename.csv" for the exporting the filename and path.

 

When I run the script within the client it works perfectly.  The exported document is placed in the documents folder.  However, when I try to run it from the server no file is created.  I have placed a send email command into the script which shows data from the last record in the found set and the email is sent correctly, so I know the set of records is constrained successfully.  All of the script steps are compatible with a server script, and when the script is run from the server it does so without errors.

 

 

Any suggestions of what I am overlooking?  Thanks.

 

Joe

Link to comment
Share on other sites

What path are you checking for the Documents folder? If you aren't already, it might be useful to include that in your diagnostic email. On a client, Get ( DocumentsPath ) returns the Documents folder for the current user logged-in to the OS. From the perspective of a server-executed script, there is no user logged-in to the OS, so it's less obvious where the documents folder is. I believe the default path is {applications or program files, as appropriate for the OS}/FileMaker/FileMaker Server/Data/Documents/

Link to comment
Share on other sites

From the perspective of a server-executed script, there is no user logged-in to the OS, so it's less obvious where the documents folder is. I believe the default path is {applications or program files, as appropriate for the OS}/FileMaker/FileMaker Server/Data/Documents/

 

No, on the server, the get(documentspath) returns the "Documents" folder inside the FMS folder structure; it is not user dependent.

 

Joe: in your post you don't have the "file:" or "filewin:" or "filemac:" prefix, I'm assuming you do have that in your script when you put the path together?

Link to comment
Share on other sites

The problem has been solved. The script and the schedule was working perfectly.  I was the error.

 

After reading JBante's post, it lead me to figure the problem was where I was looking for the exported file.  Because I was logged into the server, I was looking into the documents folder for that user on the server: /ServerHD/Users/serveradmin/Documents/SR-patients.csv

 

 

As suggested, I put get(documentspath) into the test email and it showed: /ServerHD/Library/FileMaker Server/Data/Documents/SR-patients.csv

 

Wim of course is correct in that get(documentspath) is not user dependent.  Its just that the user didn't realize his documents folder was different that Filemaker's documents folder.

 

Thank you both for your replies.  Greatly appreciated!

Link to comment
Share on other sites

No, on the server, the get(documentspath) returns the "Documents" folder inside the FMS folder structure; it is not user dependent.

 

Is that not what I said?

Link to comment
Share on other sites

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