If a user enters “Concept Plan” into my JobTypeTX field and then closes my form, I want to ask that user if he wants to send an email. If he says Yes, I want to use @MailSend to create the email, attach a link to the document, and send the email. Where is the best place to put this kind of formula? Postsave? Onunload?
Subject: Formula to send email from Form Close/Save
The best way for me is Action (Formula/Script)not in any events. If you code in event there’re a lot of cases that you have to consider.
Nakorn Ph.
PCLP, PCLI.
Subject: RE: Formula to send email from Form Close/Save
And if you use an action, you have only to consider the case that the user doesn’t use your action. ESC then Enter will save and close the document. What happens to the mail option?
Use the PostSave or QueryClose event. Make sure that the field value is actually changed since the document was opened before offering to send the mail.
Subject: RE: Formula to send email from Form Close/Save
Depends, do you want the user to be prompted everytime the document is merely opened/closed or only when changes are made and its saved?
ST
Subject: RE: Formula to send email from Form Close/Save
I want to ask the user after the doc has been saved if they want to send the email. Here’s what I’m trying, but it’s not sending the email.
emailSubject := “New Plan”;
emailBody := “There is a new Plan in the database.”;
emailDocLink := @NewLine + @NewLine + "Double-click on this document link to access the project. → ";
@If(JobTypeTX = “Plan”;
@If(Send := @Prompt([YesNo]; “Send email?”; “Do you want to send an email about this Plan?”) = 1);
@MailSend(email name to send to inside double quotes; “”; “”; emailSubject; emailBody; emailDocLink; [IncludeDoclink]);
“”;
“”)
Any ideas?
Subject: RE: Formula to send email from Form Close/Save
Try this:
emailSubject := “New Plan”;
emailBody := “There is a new Plan in the database.”;
emailDocLink := @NewLine + @NewLine + "Double-click on this document link to access the project. → ";
@If(JobTypeTX = “Plan”; @Success; @Return(“”));
ans:=@Prompt([YesNo]; “Send email?”; “Do you want to send an email about this Plan?”);
@If(ans=1 ; @Success ;@Return(“”));
@MailSend(email name to send to inside double quotes; “”; “”; emailSubject; emailBody; emailDocLink; [IncludeDoclink]);
Subject: RE: Formula to send email from Form Close/Save
Perfect, Thanks!
Subject: Formula to send email from Form Close/Save
If you are interested in a LotusScript solution let me know at bendraper@hotmail.com.