March 14, 201015 yr I have the following script: Set Error Capture [On] Perform Find [Restore] If [Get (FoundCount) = 0] Exit Script [ ] End If If [isValid(Contact_Data::DupWarning_Address) or IsValid(Contact_Data::DupWarning_ID) or IsValid(Contact_Data::DupWarning_Name) or IsValid (Contact_Data::Incomplete_Record_Warning) Go to Layout ["Volunteer Information Sheet" (Contact_Data) Enter Browse Mode [ ] End If I have set the script, using File Options, to run when the file is opened and when it is closed. It runs fine when the file is opened, but it will not run when the file is closed. Anybody know why? TIA
March 15, 201015 yr Is the script not running or only running part way? Test by putting pauses after each line so you can see what's going off. What purpose does this serve on closure?
March 15, 201015 yr Author The reason I want it to run at shutdown is to alert the users to eliminate any duplicate records they may have entered BEFORE they exit the program. As I said before, the script does run as intended when the file is opened. but not when the file is closed. I want it both ways to totally insure the a user knows there is an erroneous record. Putting Pause before the last step works so I guess I will leave it at that. Thanks,
March 15, 201015 yr Author I guess I thought the If [Get (FoundCount) = 0] Exit Script [ ] would do that if no dups were found, and that if they were the succeeding steps would cause it to enter Browse mode, thus ending the script. Anyway, putting a Pause step just before the last End If makes it work the way I want it to. Thanks for your interest.
March 15, 201015 yr If you want to stop the window from closing you'll need to use custom menus and trap the Close command. The reason I want it to run at shutdown is to alert the users to eliminate any duplicate records they may have entered BEFORE they exit the program. Note that in FMP 9 and earlier you cannot stop the window form closing if the user exits the program, only if they close the window. With FMP 10 and later you can stop the program from exiting: set the script result to "false" and run it as a closing script.
Create an account or sign in to comment