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.

FM7 - Scripting error capture

Featured Replies

Hi,

I've set up a script for a user to add another record (unique) in a related db. What I want to amend the script to do is throw up a message if the field is not unique. I'm trying to use the Get(Last Error) = 11 but i suspect this is SQL only???

I know I could script a search and if result = 1 run it, but was wondering if there was an easier (shorter) way to script it??

What does your script look like and which field is being tested?

  • Author

It's just a standard text field.

I think I'm doing it the wrong way around, before I create the record I should test if the global value already exists in the table??? I have the field validated to be unique.

Show Custom Dialog [Enter New Industry; gInput]

Go To Layout Industry

Create New Record

Set Field Industry; gInput

Commit Records 

(this is where I really need it to say if(Get (Last Error) = 11 show dialog "error record already exists" and roll it back?:)

Before I create the record I should test if the global value already exists in the table?

Yes! It's much easier this way. Just create a relationship between gInput and Industry. Then after the Show Custom Dialog step, add If [isEmpty(relationship::Industry)] before creating a new record. If the test is true, there is no related Industry. If it's false, one already exists.

  • Author

thanks! I'll re-write when I get back to work after the long weekend.. ahhhh such is life with salary payments laugh.gif

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.