I have a new document that has been saved and assigned to me. When I open the doc, and then press Save & Exit, the doc asks me if I want to save my changes. The code behind the Save & Exit is as follows…
@Command([RefreshWindow]);
@Command([FileSave]);
@Command([FileCloseWindow])
What gives? Why does it ask me if I want to save when the doc is closed out via that button?
I’ve also tried using the following code to insure that the file saves first…
@Command([RefreshWindow]);
@Command([FileSave]);
@PostedCommand([FileCloseWindow])
FYI - I do see that the file actually saves via the code in my revisions.
Any thoughts?
Subject: Do you want to save your changes?
Scott,
Is anything happening in the QuerySave event on the Form???
Mike
Subject: Do you want to save your changes?
try using @postedcommand([filesave]) as well as for the close window. The refresh could still be happening after the save.
Subject: RE: Do you want to save your changes?
This worked! I don’t know why I didn’t think to try this, it was so simple. Just inexperience I guess. Thank you so much.
Also - Thanks to the others that wrote in. The @IsValid was a great idea. There is stuff in the QuerySave, but its all @If statements with @IsNewDoc.
BIG HELP! That was so irritating! I’m so happy to have fixed it now.
Subject: Do you want to save your changes?
You shouldn’t really have to do a RefreshWindow if you are saving, as the fields are computed when the document saves anyway. But here’s an alternative which should work OK:
@If(
@IsValid; @Do(
@Command([RefreshWindow]);
@Command([FileSave]);
@SetField("SaveOptions"; "0");
@Command([FileCloseWindow])
);
“”
);
Like I said, probably don’t need the refresh window, so you might be able to get rid of that line.
Hope this helps,
Craig.