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

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

Recommended Posts

Posted

I am running FM 12 03 advanced in OSX.

 

I have a layout called Patients.   I have allowed the 'X' close button the window to let the user close the window. 

 

When the user clicks the 'X' to close the window, I prompt the user with the querstion: "Are you sure you want to exit ?" (Y/N)

 

If they press No, I want to negate the 'X' close window button and leave the window open.

 

post-72145-0-18052700-1353195179_thumb.j

 

post-72145-0-80867000-1353195099_thumb.j

 

The problem is that at the end of the script, even if the user says 'No', after the script closes the window closes anyway.

 

I think I can capture their response in a $$Variable and then after the window closes if $$Variable ="No" then reopen the window.  But, isn't there a way to negate the "X" choice and just leave the window open?

 

 

Posted

Before 'End If' add the script steps:

Else

Exit Script [Result: 0]

That worked. 

Am I correct in understanding that letting all the script steps complete WITHOUT a EXIT let's the 'X' close window complete.  But, when I interrupt the script with the Exit, it aborts the 'X' Close?

 

Thanks for replying...

Posted

You need to make the script result 0 (zero, false). Then the intended user event is canceled. This works only with triggers which are executed before the triggering event of course.

 

When the result is based on a calculation make it 1 (one, true) to allow the event

 

See the help for more information (click on a trigger to see if it is executed before or after the event)

 

http://www.filemaker.com/12help/html/script_trigg.38.1.html#1029602

  • Like 1
Posted

I believe this is better off handled using a custom menu, by  modifying the Close command to issue the prompt.

 

Also, don't exit the FMP application, just close the window. An assumption is being made that your window is the only one that the user has open. I find nothing more annoying than closing somebody's database only to find that it quits the whole application. The horror!

  • Like 2

This topic is 4386 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.