Error "Attempt to execute nested form events."

I am adding a button to my e-mail database to allow me to send an e-mail to a recipient and copy the e-mail to a central mail database when I send it. This new button uses the field “SaveOptions” which we added to the memo form to prevent a copy being saved in the user’s mail database when it sends it and copies it to central mail.

After adding the field SaveOptions I now get the error message “Attempt to execute nested form events.” if I try to use the existing Send button for mail that I do not want to send to the central mail database.

Does anybody know why I get this error?

I get this error message

Subject: RE: Error “Attempt to execute nested form events.”

A form event is, for instance, Querysave. A nested form event occurs when the event code does something that would cause itself to be run again. E.g. if the Querysave event calls NotesUIDocument.Save, that would cause Querysave to run. But wait! We’re already in Querysave. The system aborts the script with an error, to prevent infinite regress.

If you want to mail a copy to a central database, why don’t you just have the action button add the email address of the central database to the BCC list of the memo, then do whatever the regular Send action does? All this business of saving and mailing the document multiple times, with and without SaveOptions, is bound to cause the sort of complications you are seeing.

Subject: RE: Error “Attempt to execute nested form events.”

My agent does exactly what you suggest. It adds the address to send the document to the Central Mail database in the BCC field. The thing I would like to avoid is once I click my new button (Send to Central Mail) I don’t want to be prompted to save a copy on my local mail file. If people still save the e-mail on their local mail file then I am duplicating these e-mails.

Subject: RE: Error “Attempt to execute nested form events.”

I figured it out. Once I set my User Preferences to “Don’t Save a Copy” of Sent Mail. Then everything works fine.

Thanks for your input Andre!

Ron