Search DominoPower's 11,422 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
LotusScript agents and the Web (continued)

This function will only work for names that do NOT have a middle name or a last name with a space. There are several examples of recursive functions that will support those situations, but for now, this one will work for this example. What we're doing is moving to the first occurrence of a plus sign (+) and setting all the characters before that first plus sign to the variable firstname, and then setting all the remaining characters after the plus sign to the variable lastname. We add the two variables together with a space and we have Chris Stoner. This is the hard way of doing @ReplaceSubstring(UserN; "+"; " "), but I'm trying to show other uses for Instr and Mid, as they're powerful tools for the LotusScript Developer.

Next, we use our parameters to mark our document Approved:

REM get handle to the Document that we need to modify...
Dim db As Notesdatabase
Dim doc As Notesdocument
Dim session As New NotesSession
Set db = session.CurrentDatabase
Set doc = db.GetDocumentByUNID(docID)

First, we need to find the correct document. We'll search by the document ID in our variable docID, which was passed to the Agent. Once we have a handle to the document, we simply set it to be Approved with the Approver's name and the current date.

Dim test As String
doc.RemoveItem("Approver")
doc.Approver=frmtName$

doc.RemoveItem("ApproveYN")
doc.ApproveYN="Approved"

doc.RemoveItem("ApproveDate")
doc.ApproveDate= Format(Now(), "mm/dd/yy")

We must save this Agent so our changes will appear when the document is next viewed.

Call doc.Save( True, True )

Let's return the Approver to the document that they just approved.

'Return to document we just approved....
Print "[/" & db.filepath & "/all/" & docID & "?OpenDocument]"

Now the process is complete.

Closing
Many developers have LotusScript Agents that they currently use within the Lotus Notes environment for a variety of purposes. With this example, I hope that you'll be able to consider whether or not these Agents can be modified to be used over the Web as well.

Bulk reprints
Bulk reprints of this article (in quantities of 100 or more) are available for a fee from Reprint Services, a ZATZ business partner. Contact them at reprints@zatz.com or by calling 1-800-217-7874.

Chris Stoner, formerly Chris Brown, is a Principal CLP Notes Developer (R4 and R5) currently based in the Washington, DC Metro Area. Other Notes Developers may recognize Chris by her alias, Green Jellybean, which is the nickname for her green Toyota RAV4. She can be contacted at green_jellybean@bookideas.com.


« Previous  ·  1  ·  2  ·  3  ·  4
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
New Notes/Domino Technotes published about Chile's extended daylight saving time
SnnT: How to prevent Google from listing your Sametime Server
How to send someone an email that shows your calendar availability
"The collection has become invalid"
More XPages onclick event weirdness...
Domino 8.5.1 Fix Pack 1 Interim Fix 1 (8.5.1 FP1 IF1) - DAOS Fixes
Domino Designer 8.5 Tip: Where Working Sets Are Stored
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login