Error messages

Good Morning all,

I have this LotusScript code behind my querysave that checks a view for duplicate entries based upon 3 fields on my main user input activity form. If a user were to make an edit to the document the code allows editing without having to change one of the 3 main fields in order to re-save the document. I guess thats where my problem is. When I run it through the debugger I can see that it does not like the line of code: Call uidoc.Save, it kicks out 2 error messages.

The first being: Attempt to execute nested form events

The second being: NotesUIDocument: Save cancelled

But it allows the changes and re-saves it anyway.

Here is the code:

If dc.Count = 0 Then

			Exit Sub

		Else

			If dc.Count = 1 And Not(uidoc.IsNewDoc) Then

				Set tempdoc = dc.GetFirstDocument

				Set docB = uidoc.Document

				If tempdoc.UniversalID = docB.UniversalID Then

						Call uidoc.Save

				End If	

			Else		

				Messagebox"This entry could be a duplicate, please make sure the DUTY STATUS is accurate.",48,"Error."

				Continue = False

				Exit Sub

			End If

Any suggestions as to what is happenning. The code works, I just need to get rid of those error messages.

Subject: Error messages

The save event launch the QuerySave script, before the effective save.

When you try to save the uidoc in the querysave script, you “attempt” to execute the save event again and so on…

Of course save is cancelled.

The document save is request,anyway it will be done.

Try this :

If tempdoc.UniversalID <> docB.UniversalID Then

continue=false;

End If

Subject: RE: Error messages

Thank you so much Anne! It works! No more error messages, I had searched the site for information about the error messages I was getting and there was info, but none specific to my problem. Thanks again!