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.

FMS8 breaks previously working script

Featured Replies

  • 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]

TIA

Edited by Guest

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?

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.

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.