Help with querysave event script

I have some simple Lotus Script in querrysave event that I can’t figure out.

Under a certain condition, I would to return to the form without saving, and without prompting to save. Seems simple. According to the Designer help , I can set the continue variable to ‘False’ and the document will not save. However, when continue is set to ‘False’ I still get prompted to save. If I answer “No”, the document closes with out saving, if answered “Yes” the it runs the querrysave event again.

How can I get it to just cancel the save and put the user back in the form to edit?

Here is a code snippet:

If answer=6 Then

		Call source.FieldSetText("MiscChargeFlag","YES")

		Continue=True

	Else

		Continue = False

	End If

Subject: Help with querysave event script

Not sure what the rest of your event script does but I would add the exit sub if you are wanting it to go directly back the form at that point. If not you may want to check the continue value at some point in the script later one before it calls the doc.save etc.

If Source.FieldGetText(“answer”)=6 Then

 Continue=True

Else

 Continue = False

 Exit Sub

End If

Subject: RE: Help with querysave event script

Thank you. I have tried that.

Here is the complete ending code as it is now:

	If answer=6 Then

		Call source.FieldSetText("MiscChargeFlag","YES")

		Continue=True

	Else

		Continue = False

	End If

	

End If	

If mFlag<>1 Then

	Call source.FieldSetText("MiscChargeFlag","")

End If

End Sub


I have tried adding an Exit Sub command within the ‘If’ block with the same results.

Subject: Help with querysave event script

How are you saving and closing the document?

If you are using the following in an action button, (which I think you might be):

@Command([FileSave]);

@Command([FileCloseWindow])

Then you should change it to the following:

result:=@Command([FileSave]);

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

Then if the Save is cancelled by setting Continue to False, it will not try and close the window (which will ask you if you want to save the changes).

Hope this helps.

Charlie.

Subject: RE: Help with querysave event script

YES! That is it. Simple now that I see it. Thank you very much for the help.