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.

Preventing empty Fields

Featured Replies

I'm baffled by a simple (I thought) script I've set up to create new 'Keywords' in a Lexicon Table that holds a record for each Keyword that the user can use to 'tag' various media items via a join field.

Each Keyword involves 3 fields (Word/Category/Authority) and I've set up global fields for their entry and a script that takes these values and creates a new Keyword record based upon them. This has been working fine.

But I want to make sure the user can't create a new Keyword with any of the three fields empty. So at the beginning of the script I did a triple "IF" condition:

IsEmpty ( CFA_Lexicon::NewKeyword_g ) or IsEmpty ( CFA_Lexicon::Lexicon_Authority ) or IsEmpty ( CFA_Lexicon::Lexicon_Category )

-- whereupon you get a dialogue box scolding the user to fill in all three fields, and Exit Script.

So, here's the odd thing: when the Lexicon Window where all this action goes on is first opened, the script allows me to create a Keyword with empty fields . . . ONCE. Thereafter the script enforces field entry as I planned. Or, if I create the flawed record and then delete it the script allows me to do it again. My record creation script clears the three global fields after creating a new record, and I've added the same global-clearing commands to the script that opens the Lexicon Window too, for good measure --- - SetField[GlobalField1;""] etc.

I'm having a hard time pinning down exactly when it allows the flaw. I've tried the process with the data viewer watching the global fields and stepping through with the debugger -- and sure enough, at these times the script allows me to step *right through* the IsEmpty test even though I can see that the Global Fields are empty in the data viewer!!!!

Whatever can the matter be?

Albert

I've set up global fields for their entry and a script that takes these values and creates a new Keyword record based upon them. This has been working fine.

But I want to make sure the user can't create a new Keyword with any of the three fields empty. So at the beginning of the script I did a triple "IF" condition:

IsEmpty ( CFA_Lexicon::NewKeyword_g ) or IsEmpty ( CFA_Lexicon::Lexicon_Authority ) or IsEmpty ( CFA_Lexicon::Lexicon_Category )

I see CFA_Lexicon::NewKeyword_g is indicated to be a global but the other 2 fields look like regular fields. Could this be your problem?

I use a custom dialog box for this so i don't need to have the field on a layout.

  • Author

Oh . . . FOR CRYING OUT LOUD!

I can't believe I wasted nearly an hour and ruined my lunch overlooking that simple error -- thanks Ralph!.

Albert

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.