I have a script that executes when field1 is exited that "goes to field" field2.
What script trigger are you using? OnObjectExit? OnObjectSave?
Do you end that script with Exit Script [False] in order to go to field 2 in your script and keep the user's "exiting event" (such as clicking another field) from being processed after the script ends?
You might also consider using Show Custom Dialog with two input fields. This automatically restricts your user to accessing only the two fields, but also allows you to implement a cancel option if such is of use to your interface design.
I had not thought of that, thanks.
I coded a script that has a loop step, then the custom dialog to enter the values into 2 text fields which correspond to 2 actual fields in the database record of the current layout. The next step does a commit, then the 2 values are compared and if equal the exit loop step is executed. the next step (executed if they don't match) is another custom dialog box that just says they screwed up and then the end loop. Simple, right?
When the script executes, the data from the input fields is never put in the db records so the test always passes - compares empty to empty.
The script debugger and data viewer confirm that the steps execute as expected except the database fields never get the values entered.
Here's the script
and here's the dialog box as the user sees it with test values place in the input fields that should fail the test....
Are you using Filemaker 12 or an earlier version?
If using FileMaker 12, make sure that the Commit option is enabled for the OK button in your custom dialog.
The commit records step after the show custom dialog step should not be needed.
Once you get this figured out, I suggest modifying your exit calculation to keep the loop from exiting if the user leaves both input fields empty and clicks OK.
Using FileMaker Pro 12 Advanced.
There's quite a bit clean up that I'll do once it works...
The first attempt didn't have the commit script step so I added it. I'll test it with the commit on for the OK button.
Turning Commit on for the OK button fixed it. But why didn't the commit script step have the same effect?
thanks for your help,
It's due to how the show custom dialog step is designed. In some situations, you don't want any data to be committed if "cancel" is clicked. The data never makes it inot the specified fields to be committed by the follow on Commit records step in those cases.