• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Mailsend with a prompt

I would like to send a email but ask the associate first. The workflow is that they are adding a Testing Procedure to a reminder calendar and I wanted to also include a prompt asking "Would you like to send a email reminder?" and then if they click Yes, an email is sent to their email box (I have a user that wants to add it to To Do or something, I am not worrying about it once it is a email). But if they click No then it would not do anything. I am not sure how to do this in formula. Below is what I have so far but of course, it does not work. I am not sure how to use the @Do or @DoWhile with a @Prompt. I get a @If Statment but what i think I am missing is that if I ask the question "Do you want the email?" Yes or No, how do I tell the code that on NO, do nothing, but if it is Yes, then do the @MailSend? Any help would be great - Thanks!
@If(@IsDocBeingEdited; ""; @Command([EditDocument]));
@If(!@Command([ViewRefreshFields]);@Return("");"");
@UpdateFormulaContext;
@Command([FileSave]);
 
FIELD AllowClose := "1";
FIELD SaveOptions:="1";
FIELD C_Status :=Status;
FIELD Person := @If(@IsNewDoc;@Name([CN];@UserName);@Name([CN];@UserName):Person);
FIELD ActionDate := @If(@IsNewDoc;@Now;@Now:ActionDate);
FIELD Action := @If(@IsNewDoc;"Saved Doc";"Saved Doc":Action);
@Prompt([Ok];"Reminder Date";"Your reminder date has been saved");
@If(@Prompt([YesNo];"Send Email Reminder";"Would you like an email sent to add to your personal calendar?";
@Do(@MailSend(Owner;"";"";"Reminder for Testing":"This is a reminder for testing";[IncludeDocLink);
@Prompt([OK];"Email Sent";"A Email has been sent to "+Owner);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])

Open in new window

0
kali958
Asked:
kali958
  • 3
  • 2
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
You should add some indentation, so you can see that you got the level of parentheses right.

@If(@Prompt([YesNo];"Send Email Reminder";"Would you like an email sent to add to your personal calendar?";
      @Do(
            @MailSend(Owner;"";"";"Reminder for Testing":"This is a reminder for testing";[IncludeDocLink);
            @Prompt([OK];"Email Sent";"A Email has been sent to "+Owner)
      )
);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])
0
 
Sjef BosmanGroupware ConsultantCommented:
Oh, darn, there's more missing...

@If(@Prompt([YesNo];"Send Email Reminder";"Would you like an email sent to add to your personal calendar?");
      @Do(
            @MailSend(Owner;"";"";"Reminder for Testing":"This is a reminder for testing";[IncludeDocLink]);
            @Prompt([OK];"Email Sent";"A Email has been sent to "+Owner)
      );
      ""
);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])
0
 
kali958Author Commented:
How does the code know that if they answer yes to do the mail send and if the user clicks no, it knows not to do the mailsend?
0
 
Sjef BosmanGroupware ConsultantCommented:
See the Help database, on @Prompt: that function returns true if Yes is clicked.
0
 
kali958Author Commented:
that is the part that was confusing me in the Help that I needed a bit of translation on.
Thanks for the answer I am going to try now.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now