I use this in a button.
First a open Names and pick one person, then a open a new window (Dialogbox). If a press cancel there it’s still send away the e-mail. Where did a wrong?
subject:="Changenumber: " + ChangeNumberSum;
body:="Follow the link. => ";
sendto:=@PickList([Name]);
form := “DlgComments1Email”;
title := “Description of and cause for change - Comments and notify!”;
FIELD Notify1:=“Notify e-mail to “+ @Name([CN];sendto)+”.”;
FIELD TempField1 := CommentField1;
@DialogBox( form ; [AutoHorzFit] : [AutoVertFit]:[NoNewFields] ; title );
FIELD CommentField1:= TempField1;
@Command([ViewRefreshFields]);
FIELD Notify1:=“”;
@MailSend(sendto;“”;“”;subject;“”;body;[IncludeDoclink]);
Kind regards
Fredrik