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.

cancel add record w/required fields

Featured Replies

  • Newbies

I have a db with three required fields. I want to use a script to allow a user to cancel a record add. As is, I keep getting the error that fields are empty... how can I cancel the add. (Related, maybe...how to postpone save of a record?).

The approach I've taken with this sort of situation is to script the entire process like so:

User clicks on New Record button, which calls New Record Script

New Record Script takes user to a layout with global fields (one global field per actual data field). This layout also has two buttons: Cancel and Submit.

If user clicks on Submit, the script creates a new record and populates the fields with the values in the matching global fields. You can also test for required values at this point, either within the script itself or using FileMaker's built-in validation. Doing validation through ScriptMaker allows for a more complex validation procedure.

If the user clicks on Cancel, the script simply returns the user to the original layout.

In both cases, the script will clear the global fields regardless of which button was clicked.

Hope this helps!

I script such processes start to finish too, but without adding global fields.

The mandatory fields are not set up to be Not Empty in the field validation setup, because the controlled New Record script is already taking care of that.

When they add a new record, the New Record layout only allows them the Cancel or Enter option. Cancel backs out of the New Record script, and deletes the new record that was aborted.

The Enter script checks to make sure all fields were entered as needed, and only then proceeds.

This way no Global fields are needed.

  • Author
  • Newbies

Originally posted by Sharka:

>>Cancel backs out of the New Record script, and deletes the new record that was aborted.

Q: what is "backs out" in terms of script?

>>The Enter script checks to make sure all fields were entered as needed, and only then proceeds.

Q: example?

I'm pretty new to scripting and would greatly appreciate any examples.

-TIA

Andrew

Sorry for my cryptic responses... I hope this helps.

By 'Backs out' I meant that if you select the CANCEL script, it returns you to where you started, _and_ deletes the new record you started, but never finished (because you chose the Cancel option).

- -

>>The Enter script checks to make sure all fields were entered as needed, and only then proceeds.

The Enter script allows you to proceed, but only after it's checked to see that the mandatory fields have been filled in. For example, a simple ENTER script, checking to see that two fields are not empty could look like this.

IF ["IsEmpty(field_1)"]

Exit Script

END IF

IF ["IsEmpty(field_2)"]

Exit Script

END IF

--- proceed with script ---

You can make the IF conditionals more complicated than just seeing if the field is empty, as the ones above do. Checking for characters entered, etc.

In the case above, if for exmaple field_1 is empty, it exits the script. you could add a Show Message just prior to the Exit Script step, telling the user user whicih field they need to fill in before proceeding.

HTH smile.gif" border="0

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.