@Command([FileCloseWindow]) with no save prompt

Hi All

Does anyone know if it is possible to disable the save option when using @Command([FileCloseWindow])? Or is there another command I can use? I’m using it in a prompt, and if the user selects no I want the form to close without asking them if they want to save it.

Thanks

Jenny

Subject: well …

You can always use the two commands

@Command( [FileSave] ) ;

@Command( [FileCloseWindow] )

to force the save whether they like it or not

However I suspect you want the opposite

  • you want teh form to close WITHOUT a save if the user says NO.

In this case what you need is SaveOptions. You can find it in the help or by search these forums

Its useful in several ways but I think this one will help you:

having SaveOptions on your form as computed for display

i.e. its not saved with teh real data

value @if( @IsDocBeingLoaded ; “1” ; @ThisValue )

i.e. it starts as “1” but if you set it to something else it stays that way

in your action or whatever … after the decision of course

FIELD SaveOptions := “0” ;

@Command( [FileCloseWindow])

and hey presto NO save and No prompt either

Have fun. Let us know how you get on

Subject: RE: well …

Thanks Alan - exactly what I was looking for!

Subject: RE: well …

The problem w/ the @Command([FileSave];@Command([FileCloseWindow]) (it that is the desired outcome) is that if there are validations formulas that fail- it presents the user w/ some challenges. I use@If(!@command([ViewRefreshFields]);@return(“”);“”);

@command([FileSave]);@Command([FileCloseWindow])

This way, if a validation formula fails, the formula stops.

Tom

Subject: RE: well …

Here’s a better way:

@If(@Command([FileSave]); @Command([FileCloseWindow]); “”)

The problem with using refresh is that if the validation formulas are written properly, they won’t bother to complain unless you’re saving.