Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
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

  

PreviousPrevious NextNext


Don R Green 6.Sep.06 11:36 AM a Web browser
General 6.0.2 CF2 Windows 2000


I'm trying to optimize PutInFolder by using PutAllInFolder and need help. I've read here on the forum about how fast PutAllInFolder is compared to PutInFolder but can't quite figure it out. I'm sort of a newbee to LotusScript so bare with me.

Included is part of the code that is currently working but is slow. It uses PutInFolder. The script finds body text that matches between an email example in Form01 folder and all the selected emails in the Inbox. The emails that are matches are then put into a subfolder of Form01 and removed from the Inbox.

The first test code is an attempt to use a second list to keep just the matches. Couldn't get it to work

The second test code is trying to use the original list and remove the non-matches. Couldn't get it to work either.

Please point out my flaws and include corrections. Let me know if a different approach would be better. Thanks in advance.


Working Code
*******************************
Initialize

...
Set session = New NotesSession
Set db = session.CurrentDatabase
Set m_collectionInbox = db.UnprocessedDocuments
Set FormFldrView = db.GetView("Form01")
Set docMain = FormFldrView.GetFirstDocument
Set docConflict = m_collectionInbox.GetFirstDocument

FormCntr = 0
NonFormCntr = 0

While Not docConflict Is Nothing
Call Process_Item
Set docConflict = m_collectionInbox.getnextDocument(docConflict)
Wend

Msgbox (FormCntr & " emails will be moved to ...")
...


Process_Item
...
If item.isDifferent = False Then

' this works but takes a lot of time to process each doc individually.
Call docConflict.PutInFolder( "Form01\FormLetters", True)
Call docConflict.RemoveFromFolder( "($Inbox)" )
FormCntr = FormCntr + 1

Else
NonFormCntr = NonFormCntr + 1

End If
...

Test Code using a second list
*******************************

' tried putting matched doc into another list to move
Initialize

...
Set session = New NotesSession
Set db = session.CurrentDatabase
Set m_collectionInbox = db.UnprocessedDocuments
' Set DocCollctn = db.UnprocessedDocuments

While Not docConflict Is Nothing
Call Process_item
Set docConflict = m_collectionInbox.getnextDocument(docConflict)
Wend


' tried putting matched doc into another list to move
Call DocCollctn.PutAllInFolder("Form01\FormLetters", True)
Call DocCollctn.RemoveAllFromFolder( "($Inbox)" )


Msgbox (FormCntr & " emails will be moved to ...")
...


Process_Item
...
If item.isDifferent = False Then
'type missmatch
Set DocCollctn = m_collectionInbox.getDocument(docConflict)
FormCntr = FormCntr + 1


Else

Call DocCollctn.DeleteDocument(docConflict)


NonFormCntr = NonFormCntr + 1

End If
...


Test Code using a original list
*******************************

' tried using existing list to move
Initialize

...
Set session = New NotesSession
Set db = session.CurrentDatabase
Set m_collectionInbox = db.UnprocessedDocuments
' Set DocCollctn = db.UnprocessedDocuments

While Not docConflict Is Nothing
Call Process_item
Set docConflict = m_collectionInbox.getnextDocument(docConflict)
Wend

' tried using existing list to move
Call m_collectionInbox.PutAllInFolder("Form01\FormLetters", True)
Call m_collectionInbox.RemoveAllFromFolder( "($Inbox)" )

Msgbox (FormCntr & " emails will be moved to ...")
...


Process_Item
...
If item.isDifferent = False Then

FormCntr = FormCntr + 1


Else

'this causes the next getnextdocument to fail because the previous one was deleted
Call m_collectionInbox.DeleteDocument(docConflict)

NonFormCntr = NonFormCntr + 1

End If
...








  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

 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 Connections Cloud Developers
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
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite