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

Keeping list of deleted records

Featured Replies

I am trying to write a script which, and a record is deleted, it will create a record of it's deletion. The issue is, one of our departments will print a report of all jobs due that week, and if a job is deleted, there is no notification. I have created a very basic table and layout, with the fields of order number, job title, original due date, and date deleted. I have played around with a script, in which when the delete button is pressed on a record, prior to its deletion it will copy the above fields into a new record in the deleted job layout. However, I am having an issue copying the information over into the new table. It will create a new record, and records the timestamp of deletion, but does not input the order ID, job title, and original due date. Any help on this would be appreciated.

If you could post your script that you are using I am sure we can find the problem as this is a simple task.

Basically a simple way to do this is to create variables for each field you want to archive, switch to the new table layout, create a record, and use set field to set all the fields of that new record.

Charles

The way that I would handle this would be to either use a lookup or import to copy your data from one table to the other. I would also leave the orig record in there minus all the data with a flag saying that it was archived in case you ever need to put a record back.

See here

  • Author

Here is my script as it currently stands:

(Starting from within the record to be deleted in the Active Jobs 2008 table & layout)

Go to Layout ["Deleted Jobs 2008" (Deleted Jobs 2008)]

New Record/Request

Set Field [Deleted Jobs 2008::Job Num; Active Jobs 2008::Order ID]

Set Field [Deleted Jobs 2008::Media; Active Jobs 2008::Media]

Set Field [Deleted Jobs 2008::Client; Active Jobs 2008::Client]

Set Field [Deleted Jobs 2008::Original Due Date; Active Jobs 2008::Material Due Date]

Go to Layout ["Active Jobs 2008 Form View"(Active Jobs 2008)]

Delete Record/Request[]

With this current script, it does create a new record, and it does delete the original record, but it does not copy the information over mentioned in the Set Fields script steps.

IF you start from your active jobs layout and you have a relationship to your Delete Jobs TO keyed on the primary key with allow creation of record on, you can simply set the fields from the active job side.

The way you are currently doing it, you will need to store each of those into a variable since when you create a new record it does not relate to anything or set a key field to grab the rest of the data in the other fields.

Again, you should be able to do this with an import or if you have lookups or autoenters for each of the corresponding fields in your Delete table then it coudl be done by just setting the key field.

I would have thought that you could set up a filtered relationship and just show those records marked ACTIVE. However, no matter how I tried setting up the relationship I could not get it to work properly (Only show the active contacts on the Active_Contacts Layout). The only way was in a portal within the ALL_Contacts layout. Why is that?

I agree with you that this is better served with a status field and filtering, however I have found that many users want archiving.

As for having a layout that show the active only records, wouldnt a GTRR solve that issue?

I would have thought that you could set up a filtered relationship and just show those records marked ACTIVE. However, no matter how I tried setting up the relationship I could not get it to work properly (Only show the active contacts on the Active_Contacts Layout). The only way was in a portal within the ALL_Contacts layout. Why is that?

This seems to be a popular question lately. See:

http://www.fmforums.com/forum/showtopic.php?tid/193634/

http://www.fmforums.com/forum/showtopic.php?tid/193924/

  • Author

Sorry I didn't respond sooner to everyone; got stuck in a meeting Friday afternoon. I used the Set Variables script step for the Order ID, which was set as the related field in the TO, and everything worked perfectly! I am just now getting intimate with script steps, and I wasn't aware of the set variable step until you guys mentioned it...seems like that is a handy one I will have to remember for the future! Thanks again for everyone's help.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.