How to avoid "Do you want to save this new document ?" message when saving doc with @command([FileSave])

Dear Gurus,

please help.

How can I get rid of this anoying Message ?

I have form with a button in it.

This button sets some fields and saves the document (@command([FileSave])). Setting SaveOptions to “0” or “1” makes it not better; 0 prevents any saving and 1 shows up the beloved message again.

The Database is old with about a hundred such buttons, so a transformation to script would be a pain.

Any help ?!

Subject: How to avoid “Do you want to save this new document ?” message when saving doc with @command([FileSave])

try this:

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

Subject: How to avoid “Do you want to save this new document ?” message when saving doc with @command([FileSave])

Don’t fiddle with SaveOptions in this context. Don’t insert such an item in the document; remove the item from any documents that contain one; remove the SaveOptions from the form if one exists.

@Command([FileSave]) should never produce such a message. It just saves the document, that’s all. Precisely when does this message appear?

Subject: RE: How to avoid “Do you want to save this new document ?” message when saving doc with @command([FileSave])

Here is one of the buttons.When pressed, the form is in edit mode.

@If(NName = “” | VName = “” | Phone = “” | (Placement = “Of” & (Building = “” | Room = “”)) |

RDesiredDate = "" | IO = "" | Placement = "" | Company = "" | CostCenter = "" | NAB_Mail = "";

@Prompt([Ok];"Validation Error";"Please fill out all fields");

@Do(

	@Command([EditDocument];"1");

	@SetField("RStatus";"20");

	rem "<- this triggers quersave where some additional validation occurs (script) on error CCSaveFailed is set to 1";

	@Command([FileSave]);	

	@If(CCSaveFailed = "";

		@Do(

			@SetField("Assistent";"Z");				

			@SetField("RDate";RDate : @Now);

			@SetField("RAction";RAction : "Sent to IO");

			@SetField("RPerson";RPerson : @Name([CN];@UserName));

			@SetField("RComment";RComment : " ");

			@Command([RefreshHideFormulas]);

						@Command([FileSave]);

			@Command([FileCloseWindow])

		);

		"")

)

)

Subject: RE: How to avoid “Do you want to save this new document ?” message when saving doc with @command([FileSave])

flag := @Command([FileSave]);@If(flag;@Command([FileCloseWindow]);@Return(“”))

Subject: RE: How to avoid “Do you want to save this new document ?” message when saving doc with @command([FileSave])

@Command([FileSave]) won’t, but @Command([FileCloseWindow]) will if the document fails validation or any field changes happen after the save. Wrapping @Command([FileSave]) in an @If is usually a good idea:

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

Subject: RE: How to avoid “Do you want to save this new document ?” message when saving doc with @command([FileSave])

Its surprising but tue, @PostedCommand([FileSave]) does the trick

Hope that helps

V. Patel

virupatel@hotmail.com