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.

Validation correctly

Featured Replies

I am trying to use validation for students and inventory items.

I have 3 tables: students, inventory and line items.

Within the line items table I have a layout called "checkout." The first field in the checkout is studentID (which is also the join field) and a "go" button next to it.

When the "go" button is hit, I want it to check against the student table StudentID. I created the validation area for the field and all seems to be except... when I hit the go button, it goes straight to the other layout without validation. However, if I click away from the field, it will check.

How do I automate this?

thanks

What do you mean by "check against the Student table StudentID?"

  • Author

Sorry, a little convoluted.

I have a field: Students:StudentID it is related to LineItems:StudentID.

a single field layout in lineItems requests the user to enter the StudentID. I have validation setup as a calculation where LineItems:StudentID = Students:StudentID. If it fails, it is supposed to display a dialog box: "There is no student with that ID."

There is also a button that will bring them to a different layout. I do not want it to go to that layout if it fails the validation.

I am not setting this up right. If I enter an ID and hit the go button, it goes right to the new layout. Is there a script step that I can use to prevent it from going to the new layout if it fails validation?

I hope that is a bit more clear.

Why aren't you using a value list to select a studentID in line items? Maybe the demos in this thread will help.

Edited by Guest

  • Author

I thought about a value list to begin with. I chose not to use this approach because there are 1,000 students, half of which change every year. I still can, but I was hoping to continue in this direction.

Your problem is that when you click the button your record does not commit. This is just one of those little FileMakerisms that you don't always see so it's tough to figure out.

So to fix this just add a commit record to the top of your script. Then add an if statement around your go to related record step or go to layout step that makes sure the last error is 0.

I put two versions of the script in the attached file. One of which uses a variable for the error which is just my particular preference.

I also think that you need to switch your validation to be against a valuelist that is of the student::id's

Hope this helps

StudentTest.fp7.zip

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.