|
|
|
|
|
|
|
|
|
|
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. Click 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. Click 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. Click 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.
[ Next ]
|
|
|
|
|
|
-- Advertisement --
2-Minute Tutorials
How do I...
- integrate MS Office or OpenOffice with Notes?
- create cross-tab reports and charts?
- print serial letters and mailing labels?
- create PDFs in Lotus Notes?
Check out the 2-minute tutorials here. |
-- Advertisement --
INSTALL, UPGRADE NOTES CLIENTS WITHOUT VISITING EACH DESKTOP
Use InstallPump to automate your Notes R8 migration. InstallPump enables you to rollout Notes throughout the enterprise without visiting each desktop.
- 100% fully automated Notes upgrades/installs.
- Modify the Replicator Page, Address Book, and Desktop... and much more.
See for yourself. Full evaluation copy available at installpump.com.
Download your FREE evaluation copy of InstallPump today. |
|
|
|
|
|
|
|
|