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.

Featured Replies

I have a script that imports records for two tables. It goes to a table 1 layout, shows all records, deletes them and then imports records from a FM file. It then goes to table 2, finds all records, deletes them and imports records from another FM file. The problem is that after importing into the table 2 layout it deletes all the records in table 1!!!. I've tried everthing. Is there a problem with doing two imports in one script? Is there a bug, or is my script wrong. As we use to say in the auto business, "sometimes it's the nut that holds the wheel".

Here's the script:

  • # This script imports records from the Accounts Records and Gift Card files located in the parent folder (Gift Card Manager).
  • #
  • Enter Browse Mode
  • Show Custom Dialog [ Title: "Import"; Message: "CAUTION: you are sure you want to import records? Do this for file mainenance purposes and only if you know what you are doing."; Buttons: “OK”, “Cancel” ]
  • If [ Get ( LastMessageChoice )=2 ]
  • Halt Script
  • End If
  • Freeze Window
  • #
  • # Export Accounts table records
  • Go to Layout [ “Export fields-accounts table” (Accounts) ]
  • Show All Records
  • Delete All Records [ No dialog ]
  • Import Records [ Source: “file:Accounts Records.fp7”; Target: “Accounts”; Method: Add; Character Set: “Windows ANSI”; Field Mapping: Source field 1 import to Accounts::pkRecordID Source field 2 import to Accounts::Card Number Source field 3 import to Accounts::Date Source field 4 import to Accounts::ServiceProduct Source field 5 import to Accounts::Price Source field 6 import to Accounts::Deposit ] [ No dialog ]
  • Sort Records [ Specified Sort Order: Accounts::Card Number; ascending ] [ Restore; No dialog ]
  • #
  • # Export GiftCard table records
  • Go to Layout [ “Export fields-GiftCard table” (GiftCard) ]
  • Show All Records
  • Delete All Records [ No dialog ]
  • Import Records [ Source: “file:Gift Card Records.fp7”; Target: “GiftCard”; Method: Add; Character Set: “Windows ANSI”; Field Mapping: Source field 1 import to GiftCard::pkRecordID Source field 2 import to GiftCard::PurchasedBy Source field 3 import to GiftCard::PurchaseDate Source field 4 import to GiftCard::PurchaseAmount Source field 5 import to GiftCard::For Source field 6 import to GiftCard::Card Number Source field 7 import to GiftCard::Notes Source field 8 import to GiftCard::First Name Source field 9 import to GiftCard::Last Name Source field 10 import to GiftCard::Street Source field 11 import to GiftCard::City Source field 12 import to GiftCard::Postal Code Source field 13 import to GiftCard::State Source field 14 import to GiftCard::PhoneHome Source field 15 import to GiftCard::PhoneWork Source field 16 import to GiftCard::PhoneCell Source field 17 import to GiftCard::Date Source field 18 import to GiftCard::Status ] [ No dialog ]
  • Sort Records [ Specified Sort Order: GiftCard::Card Number; ascending ] [ Restore; No dialog ]
  • #
  • Go to Layout [ original layout ]
  • Show Custom Dialog [ Title: "end"; Message: "GiftCard and Account records were sucessfully imported."; Buttons: “OK” ]

Are the two tables related and if so, is the relationship set to 'Delete related records ...'?

  • Author

Thanks for your help. You were right. The relationship was set to delete related records. I changed the script and everything is ok now.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.