[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

FM - Problem Importing from Table to Table via Scheduled Script

I am having problems with a scheduled script with the script step of importing (adding records) from table to table.  It works when I manually run it, but does not import via a schedule.  I know imports from tab delimited files work, table to table imports should work as well, shouldn't they?  See screen print attached.  (Note, I did put all the script steps into the main script and this did not help either.)
-Capture.JPG
0
rvfowler2
Asked:
rvfowler2
  • 7
  • 5
1 Solution
 
Will LovingPresidentCommented:
How is it failing? Are you getting records but no data, no records or what? If you use:

Error Capture [On]
Import Records [ ]
Set Field [ SomeGlobalField_g ; List( Get ( LastError ) ; SomeGlobalField_g]

you should have a global field that accumulates any error that is occurring when the scheduled script runs.

What I don't see is the Import Path as specified under "Specify Data Source". Your script steps should include:

Set Variable [ $FilePath ; Get ( FilePath ) ]

to determine the path of the current file and then place the $FilePath variable in the path dialog.
0
 
rvfowler2Author Commented:
No records at all.  Oh, shoot, that's right.  I think when run from the server, it doesn't connect via remote file sharing the same way it does from the client.
0
 
rvfowler2Author Commented:
Get ( FilePath ) find the path to the table.  OK, thanks.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
rvfowler2Author Commented:
No, still doesn't work from a schedule, but does work manually.  It won't import records (add them) from the TNTALERTS table/layout to the TNT_ALERTS_BACK table/layout.  However, all other script steps work.
0
 
Will LovingPresidentCommented:
Capture the error code and see what the issue is. Import Records should work with Server-side scripting but there may be special considerations regarding specifying the FilePath
0
 
rvfowler2Author Commented:
Error code is 100 file not found.  You do have a different file path for Scheduled Scripts, but the format I usually use is not working.  See below:

file:/C:/Program Files/FileMaker/FileMaker Server/Data/Databases/Vacancy.fmp12
0
 
Will LovingPresidentCommented:
0
 
rvfowler2Author Commented:
I just was about to post the same.  It doesn't actually because it explains that FM doesn't import "from another FileMaker Pro file," but says nothing about table to table within the same file.  I've posted this on Filemaker's site, but I'm almost sure they will say that the same applies.
0
 
Will LovingPresidentCommented:
As the documentation says:
Any specified file must be in the Documents folder, the temporary folder, or a child folder of either the Documents folder or the temporary folder. For example, the following are all valid paths for file.csv:
So why not do an export followed by an import to any of the allowed locations?
0
 
rvfowler2Author Commented:
Thanks Will, I already thought of that option.  Yes, it does say imports are only from the Documents folder, but then that automatically excludes any FM file, which makes no sense at all.  FM designed their database import feature so that it cannot be imported directly from table to table?   All they have to do is make the database folder one of the allowed options just like the Documents folder is.  I doubt they have, but just in case, I posted a ticket on their website just to be sure.
0
 
Will LovingPresidentCommented:
There are limitations to what server and can including the above location restrictions. There may be a work around but I've not seen it yet.
0
 
rvfowler2Author Commented:
Additional Note:  Other than importing table to table, the other issue is that we were using the wrong Documents folder.  Sometime when we upgraded FM Server, it changed the Document file path from D to C.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now