Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8105 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

I am run FMP 5.5 on Windows 2000.

I have a button called CLOSE, the script behind this button is to check some validation/mandatory fields, if it found some invalid data, it will prompt the user to correct it, otherwise it will CLOSE the application.

But when the user click File>Exit, it will quit the FMP without checking validation/mandatory fields. I asked FMP to execute the CLOSE script if the document is closed by checking off the Perform Script of "When Closing Menu" box from Edit>Preferences>Document.

It runs the CLOSE script, but after that it quit FMP without checking the data.

Here is some script steps in my CLOSE script

ShowMessage: "Invalid Data"

Halt Script

Like I mentioned above, it shows the message, but it quit FMP even it has HALT script right after ShowMessage.

What did I miss here?

Thank you

Posted

You didn't miss a thing. That is the way FM works. The only ways to prevent the user from exiting FM are to 1) keep the user in a scripted loop with a pause statment between loop and end loop or 2) use a plug-in such as SecureFM to lock out the close box and quit options.

-bd

Posted

What you need to do, is to use the sequence:

If ["put your data validation check here"]

LoopShow Message ["Some data are invalid.

Posted

this sort of thing works well in runtime solutions, because the close box is gone. instead, you have a quit button with a script that does something like this:

If

your_conditions_are _not_met

Show Message [You must still do this and that before you can quit!] Button 1=Cancel

Halt Script

Else

Quit application

EndIf

if you are running your solutions within FM, this may not work so well, but perhaps you can get your users to only use the buttons anyway.

This topic is 8105 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.