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.
Juggernaut

Function: Remove Entry and Archive Rather than Delete Record

Featured Replies

I was wondering how to create a button that removes an entry from the database and automatically archives it in a separate file linked to the database. The only function that I could find was removing an entry entirely, but I was wondering if there was any way to move the file to another database rather than delete it.

Yes, you can either use Import to create a new record in the Archive file, or you can use multiple Set Field steps, to set the multiple fields in a new record in the Archive file. There are pros and cons to each method.

ALWAYS backup immediately before trying anything like this.

1. Import

Pros: If you have a lot of fields, it's the easiest.

Cons: You must isolate the Main file to show ONLY 1 record before you call the Import script in the Archive file, or you'll get the whole found set. Which you may or may not want.

Main File:

Show All Records

Omit Record

Show Omitted Only

(or use a global ID field and self-relationship)

Call script in Archive

Archive:

Import from Main

Main:

Delete Record

2. Set Field

Pros: It's difficult to go wrong, and if it does, there's less damage. You don't have to change the found set in the Main file.

Cons: You have to set each field.

If you want to do the found set, you'd need to Go To Record/Request [First], then enclose the below in a Loop (with an Exit after Last).

It's slower than Import. It requires a relationship between the files, on the ID.

Main:

Set Field [ global ID field in Archive, Main ID ]

Call script in Archive

Archive:

New Record

Set Field [ ID; global ID ]

Exit Record (needed before using the relationship)

Set Field [ Field 1, ID relationship_to_Main::Field1 ]

Set Field [ Field 2, ID relationship_to_Main::Field2 ]

etc.

Exit Record

Main:

Delete Record

In either case you would likely want some error capture and testing, just to sure that everything went according to plan, before either Importing or Deleting.

I would do it differently. I'd keep the data in the original file, and instead change the status of the record to "Inactive" or something. Then you'd just need to adjust the Finds and relationships to show only "Active" records.

This allows you to use the same file for both, making field and interface changes consistent. If you wish, this also allows users to search for "Inactive" records instead, just by changing the Status to search for in the Find or relationship filter.

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.