Help on "Do you want to save?". Struggling with something that should be simple

I’m struggling with something that should be simple. I have input validations on fields. I have the following code in QuerySave (basically gets next available number). I have a simple @MailSend/Save/Close in my “Submit” button.

I receive the prompt from the QuerySave, I receive the prompt from the Submit button, but then I again get the message “Do you want to save”. I’ve not found what I’ve needed in previous posts. I thank you for your time…and any hints you have.

QUERYSAVE:

Temp1 := @DbLookup(“”:“NoCache”;“”;“Next Available View”;“a”;3);

Temp2 := @DbLookup(“”:“NoCache”;“”;“Next Available View”;“a”;2);

Temp3 := Temp2 + @TextToNumber(“1”);

@If(

(Status != “Pending - Not Submitted” &

(WorkTitle = “” | Source = “” | Director = “”));@Return(“”);“”);

@If((IssueNumber = “”);

@SetDocField(Temp1;“NextAvail”;Temp3);

@SetDocField(Temp1;“NextAvail”;Temp2));

@If(IssueNumber = “”;

@Do(@SetField(“IssueNumber”;Temp3);@Prompt([Ok];“IssueNumber”; "Your Issue Number is: " + @Text(IssueNumber)));

IssueNumber)

SUBMIT BUTTON

@MailSend(“Mimi”:“”;“”;“”;“B&E REQUEST: “;””;"A request has been added to the database. Please click on this doclink to get to the details>> "; [IncludeDoclink] : [PriorityHigh]) &

@Prompt([Ok];“Email Notification”;“Email was sent to Director”);

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

Subject: Help on “Do you want to save?”. Struggling with something that should be simple.

Tammy,

I didnt read your code thoroughly but Im betting… sicne you didnt mention it… the problem is related to you not having the dreded SaveOptions field… It’s a reserved field… and it will help you with this problem. Go to Designer Help - go to the Search and put in “SaveOptions” (no space).

Subject: I have … but …

I don’t want SaveOptions to be set to 0, because I do want to save it … I just don’t want it to save if there is an input validation that hit … so I don’t want to set it to 1 all the time either …

Subject: RE: I have … but …

Rather than using:

@Command([FileSave]);

@Command([FileCloseWindow])

you should almost always use:

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

That way, if the save fails due to validation (or a Continue = False in a LotusScript QuerySave), the close window is never called and the save options dialog isn’t raised.

Subject: RE: I have … but …

This might be too simplistic for what you’re looking for, but I’ve had to do it once before myself for something similar.

You could have the SaveOptions field compute to “0” or “1” based on the validation formulas. Just copy the validation formulas into the SaveOptions field. Try it at both the top and bottom of your form to see which position gives you the results you’re looking for.

Good luck!