Newbies aolong Posted January 4, 2002 Newbies Posted January 4, 2002 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 Bridge Posted January 4, 2002 Posted January 4, 2002 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!
Geeksharka Posted January 4, 2002 Posted January 4, 2002 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.
Newbies aolong Posted January 5, 2002 Author Newbies Posted January 5, 2002 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
Geeksharka Posted January 5, 2002 Posted January 5, 2002 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
Recommended Posts
This topic is 8362 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now