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.

Automated script when deleting/creating records?

Featured Replies

Is it possible to make a script excecute when a record is deleted and/or created without creating a button. Greatful for help with this matter !

PS. I use FM version 6.

Portals definition and cascaded deletes, can often be made into being helpfull if you hessitate taking the plunge into a plugin.

But we need to know a little more 'bout the scripts tasks before answering? ....If say you need to evaluate that all fields have been filled in a form, could it be done by utilizing this tecnique:

http://www.filemakerpros.com/MultiValidate.zip

...where the Count( ability to take several fields as argument can be used.

--sd

  • Author

Thanks Soren for your reply. Well... before a record is deleted a text in a field ought to bee put into a global field. After that it´s all right to delete the record. If I do this with a button the script looks like this:

Set Fileld ["serialKopID", "serialKopID & ", "& kopID"]

Delete Record/Request[]

kopID is a field with the text I need to "paste" after the information in the global filed serialKopID. After that the record will be deleted.

I need the same thing to happen even if the user uses "Delete record" from the menu or from a webinterface.

Any ideas, please... ?

It is still too abstract, what is the purpose of storing it in a global field, when it's deleted. I would guess this has something to do with availiable items in a storage and their allocation into an invoice. Now if this is the issue?? Is it not necessarily the right way to do it, because the attribute of being sold could be just be an attribute to the record.

--sd

  • Author

Thank you Soren for your patience... The situation is as follows:

I needed to generate unique serial numbers in a limited range (lets say 100 -999). Since the range is limited it is important to be able to reuse deleted serial numbers. Let´s say record 1 in a database gets sn. 100, record 2 gets sn. 101 etc. If I delete record 1, sn. 100 ought to be free to use... that´s where the script above comes in. By "saving" the serial numbers in the global field serialKopID and making sure to put back the serial number before deleting a record I always have 900 numbers available. -Now I nedd to get this to work, not only from a button, but also when using "Delete record" from the menu.

It doesn't help you much that, such things can be made purely by autoenter values in post fm6 versions - however will you be able to use the Example 2 technique shown here:

http://www.kevinfrank.com/download/multi-gtrr.zip

...although it will require some thinking to make this happen in the assignment of serial numbers is it posible!

But beyond that could you remove the ability to delete anything without using a button, in the privileges setup. Serious developers will even try to pursuade you into making it imposible to use anything but what the developer intended. No shortcut keys without serious remapping and neither unscripted navigation nor creation/deletion of records without full script control.

--sd

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.