Send document notification from a view

Posted on 2010-01-04
Last Modified: 2013-12-18

I have code attached to a button that looks at a field in the form for a list of names to send an email notification to a list of users, back to the document. This code (included in the attached section) was on a button in the TeamRoom application (called "send link to assignees") and I've tweaked it to work on a simple database design.

The list of users are pulled up from a view -- using a keyword form/document concept.  This code, (listed below) looks up the values via a @Dbcolumn formula and pops it into the form.

@DbColumn("":"nocache"; ""; "KeywordView"; 1)

What I'm looking for is a way to be able to have users select more than one document from a specific view by selecting / checking in the selection margin and then click a button on the view to send a simple email alert.  Is that possible using the list of names from the keyword field from the KeywordView  -- view.  And, is there a way to be able to select (via a dialogue box or form?) to select a subset of the names that are in the first column of the keyword view?

Maybe there is a simpler way to do what I need?
TRName := "Ready to Sell";

REM {Variables to be translated};

Title := "Mail Send";

UntitledTxt := "[Untitled]";

MailSentTxt := "Mail has been sent successfully";

MailErrorTxt := "Thre was an error sending the email.";

AssignBlank := "There are no names specified in the notification list.";

REM {subj1 is not translated};

Subj1 := @If(Subject = ""; UntitledTxt; Subject);


Subj2 := "Please review: " + Subj1;

Body1 := "An item requiring your attention has been posted to the Ready to Sell database." + @NewLine + @NewLine;

Body2 :="Please review:  " + Subj1+ "  ";

REM {End variables to be translated};


sendto := NotifyGroup;

Send := @If(@IsDocBeingLoaded; @Return(""); @IsDocBeingSaved; @Return("");

SendTo="" & @LowerCase(DocType) != @LowerCase(DefaultDocType); @Return(@Prompt([Ok]; Title; AssignBlank));

@MailSend(SendTo; ""; ""; Subj2; ""; Body1 :  Body2; [IncludeDoclink]));

FIELD mailsent := MailSent;

@If(@IsError(Send); @Return(@Prompt([Ok]; Title; MailErrorTxt));

@Prompt([Ok]; Title; MailSentTxt));

REM {ensure doc is saved and closed};


REM {if r = 0 then save has failed due to querysave or input validation checks.};

@If (r = 0;@Return("");"");



Open in new window

Question by:AliciaVee
    LVL 19

    Accepted Solution

    Instead of using @DbColumn("":"nocache"; ""; "KeywordView"; 1); why can't you use @Picklist to display a view in a dialog box? They can select multiple documents as well.
    Pls refer to Designer Help for sample codes.

    Author Closing Comment

    Provided some guidance which directed me to the help -- took a while to figure it out but was able to come up with a somewhat suitable solution
    LVL 19

    Expert Comment

    Hi AliciaVee,
    I am not sure what made you to grant a grade "B". Otherside you are telling my suggestion helped you in resolving the issue.
    Pls change the grade to "A" as my suggestion helped you. We are here to assist you and sometimes we may not be able to provide 100% soltuion without knowing full details.
    Thanks and regards,

    Author Comment

    Certainly, I understand now - makes sense. How do I change the grade?

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
    Article by: Rob
    Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now