SaveOptions and saving without prompt

I’m trying to avoid seeing the save prompt. Can anyone tell me where I’m going wrong?

Thanks,

Angie

add_info := @Prompt([OkCancelEdit]; “Additional Information”; “Please enter any additional information.”; " ");

SendTo := Assignees;

SaveOptions := SaveOptions;

@SetField(“Comments”; add_info);

@If(@Prompt([YesNo];“Send memo?”;“Are you ready to send this message?”);@MailSend(SendTo;DocAuthor;“”;“!!! IMPORTANT - Task Assignment.”;“”;“The attached task has been assigned to you for completion: " + @NewLine + @Name([CN];Requestor) + " is requesting the assigned task to be completed by " + @Text(reqDueDate)+”." + @NewLine + “Please click on the enclosed doclink to review the assigned task.—> “;[IncludeDoclink]);@Return(””));

FIELD SaveOptions := “1”;

@Command([FileCloseWindow])

Subject: SaveOptions and saving without prompt

first of all you don’t need the "saveoptions := saveoption; line, if you really needed it then append “field” in the begining i.e. field saveoptions := saveoptions ;

second, you should set the saveoption field value to “0” if you don’t want to save the document and if you do want to save then a "@Command([filesave]) before the [fileclosewindow could help…

Subject: RE: SaveOptions and saving without prompt

Thanks, I’ve made the changes that were recommended but its still not working. Anymore ideas? This code is behind an action button and its also stopped my field level validation from working.

Thanks for any assistance you can offer.

add_info := @Prompt([OkCancelEdit]; “Additional Information”; “Please enter any additional information.”; " ");

SendTo := Assignees;

FIELD SaveOptions := SaveOptions;

@SetField(“Comments”; add_info);

@If(@Prompt([YesNo];“Send memo?”;“Are you ready to send this message?”);@MailSend(SendTo;DocAuthor;“”;“!!! IMPORTANT - Task Assignment.”;“”;“The attached task has been assigned to you for completion: " + @NewLine + @Name([CN];Requestor) + " is requesting the assigned task to be completed by " + @Text(reqDueDate)+”." + @NewLine + “Please click on the enclosed doclink to review the assigned task.—> “;[IncludeDoclink]);@Return(””));

FIELD SaveOptions := “1”;

@Command([FileSave]);

@Command([FileCloseWindow])

Subject: RE: SaveOptions and saving without prompt

Solved it myself using @PostedCommand. Thanks anyway!