innodes Posted July 23, 2007 Posted July 23, 2007 (edited) I have a layout with fields that are required, using Field Options/validation/not empty with a custom message. (Is there another way to do this?) There are also two buttons on the page, one to delete the new record, the other to go to a different layout. Both the delete and not empty functions work fine. However, if the user selects the move button with empty fields, it "breaks". First the custom dialog appears stating the field is required, that's good. Then there is another error " Go To Layout has been canceled. do you wish to continue with this script? Cancel - Continue" . If they cancel, everything is fine, but if they continue it "breaks the page". How can I ? 1 - eliminate this error dialog (I read a little about Set Error Capture), that part was easy. 2 - force it to only Cancel the Go To Layout script and not ever allow it to Continue in this particular situation. thanks Edited July 23, 2007 by Guest
aholtzapfel Posted July 23, 2007 Posted July 23, 2007 You need to validate the information in a script. Loop Pause script Exit Loop If..(your validation) End Loop Goto Layout... Your cancel button must exit the current script and your goto layout is a continue button. Once you have tested this, add a Allow User Abort (off) as the first line and it will prevent the user from closing the window without clicking any button.
innodes Posted July 23, 2007 Author Posted July 23, 2007 (edited) Thanks, but if I am reading your suggestion right it is based on the Cancel action. I don't want the user to see or access the Cancel button for the "Go To Layout" script in this situation. I am trying to eliminate that error message and to force the cancel of the "Go To" script in the background if the "Not Empty" validation has kicked up an error. The user needs to insert data into the field or delete the record before they are allowed to leave the page. Then they can use the Go To Layout button freely. Does that make sense? Thanks in advance for the help. Edited July 23, 2007 by Guest
aholtzapfel Posted July 24, 2007 Posted July 24, 2007 I may not have explained myself well here is a Very simple Sample that should do what you want. Sample.zip.zip
Vaughan Posted July 24, 2007 Posted July 24, 2007 You can get rid of the "Continue this script" dialog by putting the Allow User Abort [ Off ] step at the start. You can actively trap for the commit record error, and only continue with the script if it validates... Allow USer Abort [ Off ] ... Set Error Capture [ On ] Commit Record/Request [ no dialog ] Set Variable [ $error ; Get( LastError ) ] Set Error Capture [ Off ] If [ $error = 0 ] #Record validates. Go to Layout [ ] Else #Record not valid. End If Note that the Commit Record step needs to have the "Skip Validation" option NOT selected.
Lee Smith Posted July 24, 2007 Posted July 24, 2007 Do not upload files that you have to close FileMaker, in order to exit or close the file. Also, the script example doesn't do much good, if they can't look at the steps. Lee
aholtzapfel Posted July 24, 2007 Posted July 24, 2007 HUH? What do you mean? file is unlocked? Should be able to look at the script. There is an infinite loop but If you enter a value and continue or Cancel, it will Exit the script and can be closed. (I thought the point of the post was how to force entry of values before continuing. The script does that. How can you force a user to do anything if they can just close the window.)
innodes Posted July 24, 2007 Author Posted July 24, 2007 Thank you all, aholtzapfel - thanks. I appreciate your help, we are trying to automate as much as possible though, so the extra cancel button wouldn't work. vaughan - spot on! thanks for the help, and wow, it works. I am still kicking the tires, so this may come back up at some point. There is now a new error message that showed once. I will see if I can get it to disappear also.
Lee Smith Posted July 24, 2007 Posted July 24, 2007 Hi aholtzapfel, My bad, and I apologize for my other Reply. After downloading another copy of your sample file, and restarting FileMaker v9, I find that it works as expected. I'm not sure why I had the problem yesterday, but I did try the buttons (continue and cancel), with and without data, and the file would not release FileMaker from the loop. In fact, nothing short of Force Quitting FileMaker work, hence, my post. Perhaps there was something else playing a roll here (i.e. V9)? Lee
aholtzapfel Posted July 24, 2007 Posted July 24, 2007 Perhaps there was something else playing a roll here (i.e. V9)? Could be. I also threw the file together using 8.5v2 and Windows Vista. (and I am not 100% comfortable with vista and filemaker)
Recommended Posts
This topic is 6331 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