Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Joshua Martin 11.Jun.09 01:54 PM a Web browser
Domino Designer 6.5.2 FP1 Windows XP


Greetings - I have an agent that I run after selecting multiple documents in a view. This agent is in Formula. At the end of the agent I call a second LotusScript agent via @Command(ToolsRunMacro) that needs to also run on each of the documents selected.

However, when I run this, the second LotusScript agent (shown below) only runs on the first document selected. The purpose of the LS agent is to create DocLinks in the RTF of the selected documents.

I've tried replacing the While loop with If and I've tried it without the uiview.DeselectAll thinking that it might have deselected the documents after it ran on the first.

What am I missing? Any suggestions?

Thanks in advance,
Josh

--------------------------- code ----------------------------------

Dim uiview As NotesUIView
Dim dc As notesDocumentCollection
Dim doc1 As NotesDocument
Dim doc2 As NotesDocument 'must use two doc variables per IBM note regarding ADT error
Dim rtitem As NotesRichTextItem
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim workspace As New NotesUIWorkspace
Dim lookupdoc As NotesDocument
Dim polnum As String
Dim title As String
Dim varArray As Variant

Set uiview = workspace.CurrentView
Set dc = uiview.Documents ' Create collection of selected documents
Set doc1 = dc.GetFirstDocument ' Get the first document in the collection of selected docs


While Not (doc1 Is Nothing)

Set rtitem = New NotesRichTextItem( doc1, "AllCrossRefsNotes" )
Set db = session.CurrentDatabase
varArray = doc1.AllCrossRefDocIDs 'list of document ids for creating links to

Forall noteID In varArray 'loop through list of docids
Set lookupdoc = db.GetDocumentByUNID( noteID ) 'get a handle on the backend document

polnum = lookupdoc.PolicyNumber(0) 'get the policy number of the document
title$ = lookupdoc.Title(0) 'get the title of the document
Call rtitem.AppendDocLink( lookupdoc, "", polnum & " " & title) 'insert the link with policy number and title
Call rtitem.AddNewLine( 1 ) 'add a line after the link and loop back until end.

End Forall

Call doc1.Save (True, False) 'Save backend document
Set doc2 = dc.GetNextDocument(doc1)
Set doc1 = doc2

Wend

Call uiview.DeselectAll
Call workspace.ViewRefresh






Formula Agent calling Agent doesn't... (Joshua Martin 11.Jun.09)
. . RE: Formula Agent calling Agent doe... (David Jones 11.Jun.09)
. . . . RE: Formula Agent calling Agent doe... (Joshua Martin 11.Jun.09)
. . . . . . RE: Formula Agent calling Agent doe... (David Jones 11.Jun.09)
. . RE: Formula Agent calling Agent doe... (Jason V Borg 12.Jun.09)
. . RE: Formula Agent calling Agent doe... (Doug Finner 12.Jun.09)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow