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.

"deleting" to another table

Featured Replies

hi,

i have a little problem I could use some help with. I am a new user (1 month) and have created a patient management database for the hospital department I work for. Its a simple one table database. I am worried that someone might delete a record by mistake or even all records by mistake. I know I can disable deleting but there is one user account I would like to give deleting privileges to. I thought a simple solution would be to remove deleting privileges for that account but create a script that would move that specific record to another table. That way the record would appear deleted but would actually just have been moved. How could I create a script to do this? Or if someone has a better solution please let me know since I am very new at this.

Thanks

Yalon

Edited by Guest

I think a more straightforward way of doing this is to simply create a field called 'status' and toggle this between 'active' or 'inactive'. Have startup script do a find to display only the 'active' fields or view the table through a relationship which requires that 'status' be equal to 'active' to be matched.

Have a button that toggles the status from active to inactive and omits the record when you want to 'discard' it. You can create addtional scripts to restore inactive records by toggling their status back to active.

  • Author

this sounds like a great solution.

I have successfully created a "status" field and a button associated with a custom dialog script that changes status to "inactive" from default of "active" when the "yes" button within the custom dialog is selected.

Show Custom Dialog [ Title: "Delete Patient Record"; Message: "Are you sure you want to delete this patient record?"; Buttons: "Cancel" ,

"Yes" ]

If [ Get ( LastMessageChoice ) = 2 ]

Replace Field Contents [ hn database original data::Status ; Replace with calculation: "inactive" ]

[ No dialog ]

Else

Exit Script [ ]

End If

Now how do i make "inactive" records not searchable? I did not understand the rest of your post.

Thank you.

addendum:

I changed user access for all users but myself to only be able to view records if they are "active". Now the inactive ones are still viewable however all fields contain "NO DATA" message in them. Can I make them not viewable at all, even when ppl search for them?

Edited by Guest

Yalon

In your start up script, you need to add a find request.

Enter find mode

set field; "Status";"Inactive"

perform find

show omit

Status being your status field

Only the records that are not mark inactive will be shown. Be sure to hide the status area or the user will be able to toggle between the inactive and active records.

In the exit script, add the function

"Show all records"

Hope this helps

Lionel

Edited by Guest

  • Author

Beautiful, works like a charm. I also added a find button that runs a find script that sets "status" field to "active" and then searches within these "active" patienst only. Otherwise, running the find command would return all records including "inactive" ones. I'm curious as to why you suggested I add "Show all records" to my exit script. Any particular reason?

Yalon

Because as you add new records and change some records to inactive, you want to make sure that you get to view all active records.

Lionel

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.