202 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Replay Webinar IBM JUMP Session: IBM Domino Applications on Cloud
Sat, Dec 16th 2017 74
Domino 2025 Virtual Jams - The Next Chapter Begins
Thu, Dec 7th 2017 83
Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Thu, Dec 7th 2017 36
Webinar - IBM JUMP Session: IBM Domino Applications on Cloud
Tue, Dec 5th 2017 18
Save Domino Document Changes in MongoDB
Thu, Nov 30th 2017 8
Replay Webinar IBM JUMP Session: IBM Cloud Email Statistics
Fri, Nov 17th 2017 6
IBM Traveler 9.0.1.20 Available for Download on IBM Fix Central including Technote Support Feature Pack 10
Wed, Nov 15th 2017 10
Top 10
Domino 2025 Virtual Jams - The Next Chapter Begins
Thu, Dec 7th 2017 83
Replay Webinar IBM JUMP Session: IBM Domino Applications on Cloud
Sat, Dec 16th 2017 74
Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Thu, Dec 7th 2017 36
IBM Domino and IBM Notes 9.0.1 FP7 available for download on IBM Fix Central
Tue, Sep 13th 2016 21
IBM Client Application Access 1.0.1 (ICAA) Enhancements
Sun, Jun 26th 2016 19
Using iziToast an Elegant, Responsive, Flexible and Lightweight Notification Plugin in XPages
Fri, Jul 21st 2017 18
Webinar - IBM JUMP Session: IBM Domino Applications on Cloud
Tue, Dec 5th 2017 18
Using the Bootstrap 3 DateTime Picker Plugin including Moment.js and Locales in XPages
Wed, Jun 3rd 2015 17
IBM Notes Domino 9.0.1 Fix Pack 5 Released
Mon, Nov 30th 2015 15
Using Bootstrap Dual Listbox a Responsive Dual Listbox Widget in XPages
Wed, Oct 12th 2016 15


Quick Tip: Read Text File - Compare View Values - Send Email Using LotusScript
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   


Today I was asked if it was possible using LotusScript to read a Text File, which was stored in a specific Folder on the system, subsequently perform a check, based on the Values in the Text File, or a Value in the Text File is present in a specific View in the NSF and finally place the found Values in a Folder in the NSF and send an email with the found Values in the Folder to a specific email address.
The above can be solved easily by using LotusScript.

Agent Read Text File
To solve the above question I first created an Agent to read the Text File using LotusScript, compare the Values of the Text File with te Values in the specific View in the NSF and finally place the found values in a Folder in the NSF.

%REM
Agent CheckValues In View with Values in Text File
%END REM
Option Public
Option Declare

Use "General" (= Name Script Library with the Email Function)
Dim session As NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim vc As NotesViewEntryCollection
Dim doc As NotesDocument
Dim vw As NotesView
Dim fc As NotesView
Dim filenum As Integer
Dim filename As String
Dim conStatus As Variant
Dim strLineValue As String
Dim checkId As Variant

Sub Initialize
Set session = New NotesSession
Set db = session.CurrentDatabase

filenum% = FreeFile()
filename$ = "C:Tempvalues.txt"
Open filename$ For Input As filenum%
Set vw = db.GetView("($ViewName)") 'Lookup View with the Values in the NSF

'empty Folder with previous found values
Set fc = db.GetView("FolderName")
Set vc = fc.AllEntries
Call vc.RemoveAllFromFolder("FolderName")

While Not EOF(filenum%) ' Read Text File until End of File
Line Input #filenum%, strLineValue$
Set doc = vw.GetFirstDocument
Do Until doc Is Nothing
checkId = doc.getitemvalue("FieldName") 'Programmatic Name Column Value in NSF View = the first sorted column in the View = Field to Compare with Values in Text File
If strLineValue = CStr(LCase$(checkId(0))) Then
MsgBox "Found Value: " & strLineValue & +" SomeFieldName: " + doc.SomeFieldName(0)
Call doc.PutInFolder("FolderName")
End If
Set doc = vw.Getnextdocument(doc)
Loop
Wend
Close filenum%

Call sendEmail(doc)

End Sub

Function Send Email
Next, based on the found Values in the Folder I created a LotusScript function, placed in a Script Library General, to send an Email with the found values to registered persons in a Field NotificationMembers on a Profile Form in the NSF.

Function sendEmail(doc As NotesDocument) As Boolean
Dim s As NotesSession
Dim db As NotesDatabase
Dim vdoc As NotesDocument
Dim pdoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim i As Integer
Dim view As NotesView

Set s = New NotesSession
Set db = s.CurrentDatabase
Set view = db.GetView("FolderName")
Set doc = New NotesDocument(db)
Set pdoc = db.Getprofiledocument("ProfileForm")
Dim datetim As New NotesDateTime( Now() )
i=0
'- prepare mail
doc.Form = "Memo"
Set vdoc = view.GetFirstDocument

If vdoc Is Nothing Then
Exit Function
Else

While Not(vdoc Is Nothing)

'- Set recipient
doc.Principal = "SomeName"
doc.~$AltPrincipal = "SomeName"
doc.From = "SomeName"
doc.SendTo = pdoc.NotificationMembers
doc.Subject = "Found Values in Text File on" + " " + CStr(Now())

Set rtitem = New NotesRichTextItem( doc, "Body" )
Call rtitem.AddNewline(1)
Call rtitem.AppendText(vdoc.FieldName(0)) 'Programmatic Name First Column in Folder
i = i + 1
Set vdoc = view.GetNextDocument(vdoc)
Wend
'- send mail
Call doc.Send(False)
End If
End Function

A nice and easy solution to read a Text File, compare the Values in the Text Field with the Values in a View, place the found Values in a Folder and Send an EMail to specific users.

---------------------
http://xpagesandmore.blogspot.com/2017/11/quick-tip-read-text-file-compare-view.html
Nov 15, 2017
10 hits



Recent Blog Posts
74
Replay Webinar IBM JUMP Session: IBM Domino Applications on Cloud
Sat, Dec 16th 2017 5:03p   Johnny Oldenburger
On December 12 there was a very interesting IBM Jump Session, IBM Domino Applications on Cloud. JUMP stands for Join, Understand, Master and Participate. The presentation, audio and video are now available on the IBM Support website. Content IBM Domino Applications on Cloud is a subscription service that offers IBM hosted solution for Domino Apps over IBM Bluemix Cloud. The service offers a structured and planned migration process, avoiding business disruptions. In this session you will be intr
83
Domino 2025 Virtual Jams - The Next Chapter Begins
Thu, Dec 7th 2017 2:49p   Johnny Oldenburger
IBM's strategic partnership with HCL is a step towards bringing a robust and exciting roadmap for Notes Domino version 10 and beyond to increase commitment and deliver a major release in 2018. This 90 minute interactive virtual jam will give you a chance to share your thoughts on the Domino V10 roadmap including Application Development, Mail, Chat and Meetings. We want to ensure we get both qualitative and quantitative insights into the formulation of the roadmap and product vision and your at
36
Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Thu, Dec 7th 2017 2:40p   Johnny Oldenburger
There will be a very interesting webinar on December 13, Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating organized by Teamstudio. Content Topic: Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating Date: Wednesday, December 13, 2017 Time: 11 - 11:30 a.m. Boston time Are you preparing to modernize your IBM Notes and Domino applications or migrate off the platform? Notes and Domino have provided a lot of proprietary design concepts over th
18
Webinar - IBM JUMP Session: IBM Domino Applications on Cloud
Tue, Dec 5th 2017 6:40a   Johnny Oldenburger
There will be a very interesting IBM Jump Session on 12 December, IBM Domino Applications on Cloud. JUMP stands for Join, Understand, Master and Participate. Content Topic: IBM Domino Applications on Cloud Date: Tuesday, December 12, 2017 Time: 10:00 PM EST (3:00 AM GMT, 12:00 PM JST) IBM Domino Applications on Cloud is a subscription service that offers IBM hosted solution for Domino Apps over IBM Bluemix Cloud. The service offers a structured and planned migration process, avoiding business
8
Save Domino Document Changes in MongoDB
Thu, Nov 30th 2017 10:08a   Johnny Oldenburger
Some of the great 'new' development products continue to develop and evolve within the IBM Notes Domino and XPages world. Some are free to use for others has to be paid. For some time I follow the developments of one of these products closely, ClevaDesk. ClevaDesk is one of these amazing products which continues to evolve. ClevaDesk system expands IBM Notes Domino capabilities and gives it new life. There is no need to think about migrating to other technologies. Below a video about Clevadesk
6
Replay Webinar IBM JUMP Session: IBM Cloud Email Statistics
Fri, Nov 17th 2017 7:23a   Johnny Oldenburger
On November 15 there was a very interesting IBM Jump Session, IBM Cloud Email Statistics. JUMP stands for Join, Understand, Master and Participate. The presentation, audio and video are now available on the IBM Support website. Content IBM Cloud Email Statistics is a SaaS offering, providing customers with a variety of data insights on the long term use of their IBM Cloud eMail services (IBM Verse, SCN) through an intuitive graphical dashboard. In this session you will be introduced to the offe
10
IBM Traveler 9.0.1.20 Available for Download on IBM Fix Central including Technote Support Feature Pack 10
Wed, Nov 15th 2017 6:05p   Johnny Oldenburger
Today IBM released IBM Traveler 9.0.1.20. IBM Traveler 9.0.1.20 is a maintenance release that provides new features and APAR fixes for the IBM Traveler server. The information below outlines the changes included. IBM Traveler 9.0.1.20 does not include a database schema update. However, if upgrading from a version prior to 9.0.1.15 and running MS SQL Server, or if upgrading from a version prior to 9.0.1.16 and running DB2 Server, action may be required if you manually manage your database schema
10
Quick Tip: Read Text File - Compare View Values - Send Email Using LotusScript
Wed, Nov 15th 2017 4:19p   Johnny Oldenburger
Today I was asked if it was possible using LotusScript to read a Text File, which was stored in a specific Folder on the system, subsequently perform a check, based on the Values in the Text File, or a Value in the Text File is present in a specific View in the NSF and finally place the found Values in a Folder in the NSF and send an email with the found Values in the Folder to a specific email address. The above can be solved easily by using LotusScript. Agent Read Text File To solve the above
6
Update Readers and Authors Fields Using LotusScript - Adding New Values
Tue, Nov 14th 2017 6:31a   Johnny Oldenburger
During the past months I have worked a lot with LotusScript. One of the questions I came accross was how to add a value to a Readers or Authors field in the UI document using LotusScript. First a little background information. In daily practice, I make extensive use of Userroles in the Access Control List which are assigned to specific User Groups in the Access Control List. Based on these Userroles document access is granted based on these Userroles in the Authors and Readers Fields in the spec
7
A Brief Reprieve - IBM Champion Nomination Period Extended
Mon, Nov 13th 2017 12:49p   Johnny Oldenburger
The period for the nominations for IBM Champion has been extended until 30 November! This is great news. The extension offers everyone the opportunity to submit their nominations for which the original deadline was too short. For me, this means that I can submit two more nominations for which I had no time left. Just great! Thanks for this opportunity. Read the blog post by Libby Ingrassia for more information. See also my previous blog post, Become an IBM Champion - My Thoughts And Consideratio




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition