Why does @Mailsend run twice in $$Return?

To make a long story short, a $$Return field with “@MailSend” as the formula will send the email twice. Anyone know why? I would provide more details but it all narrows down to this problem.

Thanks!

Subject: Still unknown, but here is a way to prevent this problem

I was able to get the @MailSend formula in the $$Return field to only send one message by using the following:

  1. Created a hidden field at the bottom of the form called SendInfo. Field is Computed when composed and has a value of 0

  2. Under this field I have $$Return. Field is hidden and computed for display. The formula in this field is:

Field SendInfo:=@If(@IsNewDoc & @IsDocBeingSaved;1;0);

@If(SendInfo=1;

@MailSend(“User Name”;“”;“”;“Subject Info”;“A new discussion document was created.”;“”;[IncludeDoclink]);

@DeleteField)

Even if the doc is edited again, the message will not be sent.

You could also add an @Return line with html to provide feedback and a redirect.

Hope this helps someone else.

-Patrick