Jump to content

FMS8 breaks previously working script


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

Recommended Posts

  • Newbies

I have a script which archives records into an archive file, that has stopped working since my client upgraded from FMS7 to FMS8.

It does a find, to isolate the record to be archived, and then performs an import script in the archive file, to import the found set from the original file.

It then deletes the original record.

This is then repeated many times, for each of the related tables.

The records are now being deleted, but not archived. Has anyone any ideas?

This is the portion of the script for one table:

Set Field [jobs:gJob; jobs:kJob]

Enter Find Mode []

Set Field [jobs:kJob; jobs:gJob]

Perform Find []

If [Get ( FoundCount ) > 0]

Perform Script ["import_acrchive_job" from file "archive.fp7"]

Delete All Records [No Dialog]

End If

(gJob is a global to hold the key field kJob)

And the import script "import_archive_job":

Import Records [No Dialog: "control.fp7"; Add; Windows ANSI]


Edited by Guest
Link to comment
Share on other sites

Did they also upgrade the clients to FMP8?

As you have Dev7 you can trace what happens with the debug switched on.

Just a suggestion:

In your script why not test for the existance of the archive record first before deleting the main one?

Link to comment
Share on other sites

Since the proper records are being deleted, you know that the first script is working correctly. Perhaps the import[] script step in the "import_acrchive_job" script needs to have its source fields defined.

In any case Colm, you might consider changing your solution to eliminate this archive file, and instead just change the status of the records in the active table(s) so they are filtered out of relationships and Finds. This method of importing and deleting records is frought with potential problems, as you've discovered.

Link to comment
Share on other sites

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