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.

Script Find

Featured Replies

Hello,

I have a database with a text field non-unique. I would have a script that, when entering something in that field, test if there is already another record with that field value. If YES, go to the most recent record; if NOT, create a new record with the field filled with the value not found. I have try to write a script with the Find mode and the Get(FoundCount) but I am unable to succeed.¿Can anybody help me?

Thank you

Edited by Guest

I'd start by doing the entry into a global field. Set up a relationship to a self-join based on this global field and the "real" field to test for the existence of matching records (this is better than a find). Records that do match can then be "selected" using the Go to related Records script step.

The script would be something like this:

If [ not isempty( selfjoin::field ) ]

#matching records

Go to Related records [ selfjoin ]

Go to Record/request [ last ]

Else

#no records match

New Record

Set Field [ field ; gField ]

End If

  • Author

Thank you, Vaughan !

And, bccoony, there was an error in my post. I am working with FM 8.5 and 9.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.