Jump to content
Sign in to follow this  
DonDeEs

FMS11/FM11Pro Import Records Shedule

Recommended Posts

DonDeEs

Hi all.

 

I am trying to import records into a FM database from another FM database in the same machine. The script is setup on the err.. child machine to show all records then import from the parent. The import is a straight update matched by unique datestamp.

 

I can run this script fine from the local (child) file but the sheduled run of this returns an error.

 

Firstly I have tried using the script to import from the file as a windows filepath.

Next I tried to run it with the file as a remote IP address reference ie fmnet://host/filename.

Lastly, I tried to run the script to import via ODBC.

 

Each time I have set the file references by browsing, I have not written the file path myself at any stage.

 

In all circunstances I get a script error. The log file shows error 100 for the first two instances and error 802 for the last.

 

I have searched and searched but I cannot see an answer to this on this forum. Can anyone help. My gratitude in advance.

Share this post


Link to post
Share on other sites
AHunter3

Since you speak of a scheduled run, should I assume the files are hosted on FileMaker Server and you're using the Scheduler?

 

When FileMaker Server executes an import script step involving an open, hosted database file (and it IS open and hosted, yes? on the same Filemaker Server host?), you need an entry for the external data source that looks like THIS if the files are right next to each other in the same folder:

 

file:YourFileName.fp7

 

...or like THIS if the files are in separate folders:

 

file:../OtherFolder/YourFileName.fp7

 

..or like THIS if the file is in a subfolder but the file doing the importing is not:

 

file:OtherFolder/YourFileName.fp7

 

Type those types of file paths on a second line BELOW the fmnet://host/YourFileName.fp7 entries, you still need those for the FileMaker clients to be able to get the files to "find" each other.

Share this post


Link to post
Share on other sites
AHunter3

Actually I'm a bit confused by you first saying the import is from another file on the same machine and then later refer to the script as being setup to run from the child machine.

Share this post


Link to post
Share on other sites
DonDeEs

Apologies.

 

I did not mean to use the word machine here. I meant to say that one err. child file. That is to say the one that the data is being imported into from the source i.e. err parent file.

 

I use the errs as I don't really know the terminology for this. I guess source and target would be better terms but I didn't think of this at them time.

 

Thanks though for the speedy posts. Your help is always appreciated and I promise not to post needlessly.

Share this post


Link to post
Share on other sites
DonDeEs

Hi again.

 

All files are in the same folder on the same machine as the server. All files are status normal on the server. There is a tick in the 'pro' column.

 

I have added the extra line in the script step's 'specify file' window but this did not work. I still get error 100.

 

Do you mean I should add the lines to the 'manage external data sources' window in the target file, i.e go to file>manage>external data sources.

 

Thanks again.

Share this post


Link to post
Share on other sites
DonDeEs

Hi AHunter3

 

It seems importing directly from a FMS file is not supported via a FMS scheduled script. Further, importing directly from another FMP file is not supported via a FMS scheduled script. It all has to be done via a convoluted export to csv or similar then import into the target file.

 

Can you please confirm that I have not got this wrong because I really don't want it to be so.

 

http://help.filemaker.com/app/answers/detail/a_id/7035/p/874%2C953/session/L3NpZC9lRjdKZVpjaw%3D%3D

Share this post


Link to post
Share on other sites
AHunter3

Are both files OPEN and HOSTED? Are they open and hosted on the same host?

Share this post


Link to post
Share on other sites
DonDeEs

both files are hosted and open. that is to say that the status is 'normal' on the admin console.

Share this post


Link to post
Share on other sites
DonDeEs

they are both on the same host.

Share this post


Link to post
Share on other sites
AHunter3

You can't use Import Records, then, that is true. But you can used paired scripts to TRANSFER records from one table to another without using import.

Share this post


Link to post
Share on other sites
DonDeEs

Hi again.

 

Thanks for the confirmation. It will at least stop me wasting my time and hopefully others. I am sure there has been much hair pulling over this as I it highly unimaginable that FMS could not perform a simple import script that can be done in a lowly FMP file via a schedule

 

Please can you give me a pointer on the paired script... and thanks again for your time.

Share this post


Link to post
Share on other sites
DonDeEs
You can't use Import Records, then, that is true. But you can used paired scripts to TRANSFER records from one table to another without using import.

 

Please could you give me a clue as to what you mean by this. I don't mind working out the rest for myself. Thanks again for your kind assistance.

Share this post


Link to post
Share on other sites
AHunter3

Let's call the files SourceFile.fp7 and DestinationFile.fp7...

 

A script in SourceFile.fp7 does this:

 

 

Go to Layout [Table]

Show All Records

Go to Record [First]

Loop

Perform Script [in DestinationFile: SnagRecord with script parameter Table::SerialNumber]

 

Go to Record [Next; Exit After Last]

End Loop

 

 

To perform a script in DestinationFile from SourceFile, you need to add Destination File to External Data Source in SourceFile.

 

OK, now in DestinationFile you add SourceFile as an External Data Source, and then in the table you want to "import" records into from DestinationFile you create a global field, g.ImportKey, of the same field type as Table::SerialNumber in SourceFile (probably therefore a number field). Then you set up a relationship in your DestinationFile relationship diagram, like so:

 

 

DestTable (in DestinationFile)..... Table (in SourceFile)

 

g.Importkey = SerialNumber

 

 

Now you create this script, "SnagRecord", in DestinationFile; this is the script that runs once for each record when the SourceFile script is looping through all its records:

 

 

Go to Layout [DestTable]

Enter Browse Mode []

New Record/Request

Set Field [DestTable::g.ImportKey; Get (ScriptParameter)]

 

now you set all your fields in DestTable to the value of the corresponding record in SourceFile:

 

Set Error Capture [On]

Set Field [DestTable::Field A; Table::Field A]

Set Field [DestTable::Field B; Table::Field B]

etc

Commit Record/Request [no dialog]

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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  



×
×
  • Create New...

Important Information

Terms of Use