How can I check (and display a message) if Cancel Send is selected in the dialogbox (for exampel when ambigous names)@If(@Prompt([YesNo];“New message”;“Send message to …?”); “” ;@Return(“”));
Mail_Comment := “Open the document here”;
@MailSend( Myfield; “” ; “” ; “Your order …”" ; Mail_Comment + " → " ; [IncludeDoclink] );
If the document is sent I want to display a message:
@Prompt([Ok];“Mail sent”; “Your message is sent to …”)
But if the ambigous-names-dialog-box is shown and the user selects Cancel Send - then I want another message to show.
Subject: @mailsend - check if cancel send is selected
You could use the @Elements feature to see if the Myfield has any values in it…This code would be added before the @MailSend kicks off…Something like this:
Count := @Elements(Myfield);
@If(Count <= 0; @Do(@Prompt([Ok];“No Names Selected”;“No Names have been selected from the list provided. No emails will be sent”);@Return(0));@Success);
HTH
Subject: RE: @mailsend - check if cancel send is selected
Thank You.But even if the field (Myfield) has a value (a name) and this value is not unique - then the “ambigous-name-dialog-box”
is shown and I must select a unique name.
Here the user can also select the “Cancel Send”-button and it
is this selection I want to catch and show a message that no mail was sent.
Subject: RE: @mailsend - check if cancel send is selected
What do you mean by not unique??? Do you mean not unique as in it does not contain an “@” symbol or a “.” symbol???
Subject: RE: @mailsend - check if cancel send is selected
By not unique I mean for exampel one name occurs twice but with different domain (adress).
Subject: RE: @mailsend - check if cancel send is selected
A better way would be to evaluate the data entered in the field to ensure it’s valid.
Then, you don’t have to worry about the send. Also, if people press Cancel, are you sure they are expecting a mail to be sent?