LotusScript ver 6.5.1 - how to place contents of Notesitem into body of email

Posted on 2005-03-29
Medium Priority
Last Modified: 2013-12-18
The function of errorlist is to accumulate error descriptions when an error occurs.  This works just fine.

Now, I want to send an email with the content  of errorlist, but I am having no success.  This line of code  (below) "str3 = Str(errorlist)" is not working.....
Need help on correct method to place content of errorlist into body of email.

                  Dim Str3             As String
                  Dim newvalue(1)       As String
                  Dim errorlist              AS NotesItem

                  If PRhasOCOGMark = "Y" And FoundOCOG = "N" Then
                        Set  errorlist = docPR.GetFirstitem("ProdREQ_ErrorCode")
                        newvalue(1) = "Missing OCOG Split Rate for Contract"
                        Call errorlist.AppendToTextList(newvalue)
                  End If
                  If PRhasNGBMark = "Y" And FoundNGB = "N" Then
                        Set  errorlist = docPR.GetFirstitem("ProdREQ_ErrorCode")
                        newvalue(1) = "Missing NGR Split Rate for Contract"
                        Call errorlist.AppendToTextList(newvalue)
                  End If
                  If docPR.ProdReq_ErrorCode(0) = ""  Then
                        run_status = "OK"
                        run_Status = "NO"
                  End If
                  If run_status = "OK"  Then
                        docPR.ProdREQ_Status = "Active"
                        docPR.ProdREQ_Status = "Error"
                     REM ****************************************************************
                                                   REM send an email about the error
                     REM Set up the memo to email --Product request has errors
                     REM *******************************************************************      
                        Set docMail = db.CreateDocument
                        docMail.Form = "Memo"
                        docMail.Subject = "An error has occured during the processing of the Licensee Request"
                        Set Body = New NotesRichTextItem(docMail,"Body")
                              REM Set the list of people for the email
                        sendTo = send1 + ", " + send2 + ", " + send3

                        REM List of errors
                        str3 = Str(errorlist)
                        Call Body.AppendText( str1 & docCI.Licensee_Name(0))
                        Call Body.AddNewline(1)
                        Call Body.AppendText("Errors:" & str3)
                        Call Body.AddNewline(1)

                        Call docMail.Send(True, sendTo)
                  End If

Question by:BeastDan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

BarryTice earned 200 total points
ID: 13658938
First of all, it's conceivable that by the time you get to where you're trying to send mail, errorlist is empty.

The code you have sets the errorlist NotesItem under one of these two conditions:
If PRhasOCOGMark = "Y" And FoundOCOG = "N"
If PRhasNGBMark = "Y" And FoundNGB = "N"

If neither of these condition pairs is true, you never set a NotesItem into the errorlist variable.

Secondly, instead of:
str3 = Str(errorlist)

str3 = errorlist.Text

The Text property of NotesItem returns the complete text in the item, whether it be a single item or a list (array).

Hope this helps.

-- b.r.t.
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13661105
Some more remarks:
- I hope you save docPR when the mail is sent
- I wouldn't use errorlist.Text, for it just collapses all text; maybe this would be better
    str3= Join(errorlist.Values, ", ")

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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