Search DominoPower's 11,437 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.
PROGRAMMING POWER
A reusable agent to change field values on documents
By Dan Velasco

I was creating a new database in R5 recently and came across a problem I often encounter. I had several categorized documents that I wanted to change the "CategoryName" field of. Now, in the past, what I have done is to write an agent to change the value of the specific field I wanted to change. I've been through this before, however, and I knew that as soon as I made that change I would find another field I wanted to change as well. Therefore, I'd be right back at square one, writing another agent to change a different specific field's value.

Well, I knew there had to be a better way, and after a lot of coding I've found one. My goal was this: create a single agent, that could be used in multiple views, that would allow a user to change the values of fields on multiple documents they'd selected in a view. I'm happy to say that I have achieved my goal, and that is what I'm here to share with you today.

Overview of how it works
The following code is designed to work in Notes/Domino R5 and will not work as-is in Notes/Domino R4.x. It's also designed to work in a view containing similar documents, either created with the same form and/or containing the same fields. The basic structure of how the agent works is described in the next few paragraphs.

The user selects documents that have a field they want to change the value of. A dialog box asks the user to pick the name of the field they want to change, as shown in Figure A;

FIGURE A


The list of fields to change is obtained from the first selected document. Roll over picture for a larger image.

A dialog box asks the user to enter the new value of the field, with the old value given as the default, as shown in Figure B.

FIGURE B


The old value is given as the default in case the change you want to make is slight. Roll over picture for a larger image.

A confirmation screen prompts the user to make sure they want to make this change, as shown in Figure C.

FIGURE C


The confirmation screen ensures that the user is aware that the change will apply to all selected documents. Roll over picture for a larger image.

The change is made on the documents.

If this will be an agent that end-users will use (rather than just yourself), then you also will want to make sure that the names of the fields are clear enough so that the end-user can figure out which field they want to change the value of. This agent is probably best aimed at developers and advanced publishers that have a basic understanding of how Notes fields work.

Agent basics
Since this agent is pretty straightforward and well documented, I'm just going to give you the basics about the agent, how to activate it and the code, letting you play with it as you like. Think of this as kind of a DominoPower tip on steroids. Table A gives you an overview of the agent.


1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Lotus Technologies > Notes (84 articles)
   A walk down Memory Lane with Lotus Notes
   An application for scanning physical mail and distributing it virtually
   Managing Notes deployments with Teamstudio Build Manager
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
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
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
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
Adding Quick Highlighter support to IBM Lotus Notes Domino Wiki, Weblog, or Webpage
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
>> 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