SaveOptions problem in 8.5

I’m having an issue with some code in a button on a form. In R7, the code sets a field on the form and then closes it without prompting the user to save the doc. In 8.5, the user is prompted to save. I’m struggling to find a way to suppress this save dialog.

Can anyone help so that the user is NOT prompted? Here is the code that works in R7 but not in 8.5.

@Command( [EditDocument]);

@SetField(“_ViewIcon”;49);

FIELD SaveOptions := “1”;

@Command([FileSave]);

@Command([FileCloseWindow])

Thanks in advance,

Mike

Subject: Don’t use FileSave without checking the return value

I see you tried to save, without checking the return value to see whether the save worked. If the save did work, I’m at a loss to understand why the user would be prompted, as there would be no unsaved changes. So you need to explore why the document’s not saving, and meanwhile change your formula to end with:

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

Subject: SaveOptions problem in 8.5

Thanks for your suggestion. I did change the code to check for a successful save but am still having the issue. The document definitely saves… I can see the value I’m setting on the document.

Alas, I’m still getting prompted to save. I’ve tried just about every iteration of the SaveOptions field (0,1, with/without quotes).

Is there another way to suppress the save dialog? It doesn’t seem like SaveOptions is doing what it’s supposed to do in 8.5. Like I said, it works properly in 7.

Thanks,

Mike

Again, here is a sample of my code:

@Command( [EditDocument]);

@SetField(“_ViewIcon”;49);

@SetField(“SaveOptions”;1);

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

Subject: I’m sure the problem is not with SaveOptions

If this were not working it would cause all sorts of other problems and great outcry.

Check for Querysave or Queryclose code that may be making more changes to the document.

Subject: SaveOptions

I ended up changing the code to LS and got it to work. Thanks for your help.

Subject: SaveOptions

Was the [SaveOptions] field already on the Form?Designer Help states it must already be there.

If it weren’t then setting the SaveOptions value via @setfield wouldn’t work until AFTER the document is saved.