[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Recent PAQ no longer works!

I asked this question recently....

http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_21855062.html

However, the answer I accepted no longer works. It worked at the time, but now I have populated the database with more than 20,000 documents I get the following error when trying to run this agent:

"Maximum allowable documents exceeded for a temporary full text index"

Any ideas how I can fix this?

Thanks
0
shuboarder
Asked:
shuboarder
  • 6
  • 4
  • 3
  • +1
4 Solutions
 
madheeswarCommented:
I hope you have a viwe which hold Active docs. Now we can run a Schedule agent on these documents.
Make a schedule agent and check.

Dim ns As New NotesSession
    Dim db As NotesDatabase
    Dim dc As NotesDocumentCollection
    Dim doc As NotesDocument
    Dim newdoc As NotesDocument
dim actview as notesview

    Set db= ns.CurrentDatabase
set actview=db.getview("YourActiveViweName")

      Set doc= actview.GetFirstDocument
    Do Until doc Is Nothing
        Set newdoc= New NotesDocument(db)
        Call newdoc.ReplaceItemValue("Form", "TheFormnameYouWant")
        Call newdoc.ReplaceItemValue("Date", Today)
        Call newdoc.ReplaceItemValue("Name", doc.Name)
        Call newdoc.ReplaceItemValue("Details", "")                            
        Call newdoc.Save(True, False)
        Set doc= actview.GetNextDocument(doc)
    Loop

Thanks to Sjef for providing above code.
0
 
marilyngCommented:
sjef said this: SomeViewThatShowsOnlyActiveUsers

create a view containing the correct active documents,
step through the view to create each document.

Time this to see how long it takes, because on LONG agents, if they exceed the server allotted time, you have to split them up and let them pick up where they left off. So that would mean, finding a way to mark done docs so your agent can pick up where it left off.
0
 
Sjef BosmanGroupware ConsultantCommented:
A "temporary full text index", what's that? Can you post your current code, and also wheat line it decides to stop at (if you know)? And 20,000 documents is not that much...

http://www-1.ibm.com/support/docview.wss?uid=swg21093466

They suggest to create a permanent full text index for the database.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
madheeswarCommented:
And there is a catch here. The above code runs daily, so, it may create documents daily for those active docs. So, I suggest to update Active docs with some flag....like:
Dim ns As New NotesSession
    Dim db As NotesDatabase
    Dim dc As NotesDocumentCollection
    Dim doc As NotesDocument
    Dim newdoc As NotesDocument
dim actview as notesview

    Set db= ns.CurrentDatabase
set actview=db.getview("YourActiveViweName")

      Set doc= actview.GetFirstDocument
    Do Until doc Is Nothing
If doc.flag_x(0)="No" then
        Set newdoc= New NotesDocument(db)
        Call newdoc.ReplaceItemValue("Form", "TheFormnameYouWant")
        Call newdoc.ReplaceItemValue("Date", Today)
        Call newdoc.ReplaceItemValue("Name", doc.Name)
        Call newdoc.ReplaceItemValue("Details", "")                            
        Call newdoc.Save(True, False)
doc.flag_x="Yes" ' Make sure flag_x is available in all documents.set it to "No" as default value.
 Call doc.Save(True, False)
end if
        Set doc= actview.GetNextDocument(doc)
    Loop
0
 
shuboarderAuthor Commented:
Current code is:

Sub Initialize
      Dim ns As New NotesSession
      Dim db As NotesDatabase
      Dim view As NotesView
      Dim doc As NotesDocument
      Dim newdoc As NotesDocument
      
      Set db= ns.CurrentDatabase
      Set view= db.GetView("amview2")
      Set doc= view.GetFirstDocument
      Do Until doc Is Nothing
            Set newdoc= New NotesDocument(db)
            Call newdoc.ReplaceItemValue("Form", "manningform")
            Call newdoc.ReplaceItemValue("Date", Today)
            Call newdoc.ReplaceItemValue("Name", doc.Name)
            Call newdoc.ReplaceItemValue("Status", "")                            
            Call newdoc.Save(True, False)
            Set doc= dc.GetNextDocument(doc)
      Loop
End Sub

The "amview2" view is a hidden view that has selection formula:

SELECT ((Form = "Employee") | (Form = "esu")) & (@Contains(employee_status; "Active"))

This hidden form displays all the active employees. to recap, I need to create documents in the manningform for all "Active" employees on a daily basis.

Thanks
0
 
madheeswarCommented:
It should be:
Sub Initialize
     Dim ns As New NotesSession
     Dim db As NotesDatabase
     Dim view As NotesView
     Dim doc As NotesDocument
     Dim newdoc As NotesDocument
     
     Set db= ns.CurrentDatabase
     Set view= db.GetView("amview2")
     Set doc= view.GetFirstDocument
     Do Until doc Is Nothing
          Set newdoc= New NotesDocument(db)
          Call newdoc.ReplaceItemValue("Form", "manningform")
          Call newdoc.ReplaceItemValue("Date", Today)
          Call newdoc.ReplaceItemValue("Name", doc.Name)
          Call newdoc.ReplaceItemValue("Status", "")                            
          Call newdoc.Save(True, False)
          Set doc= view.GetNextDocument(doc)
     Loop
End Sub
0
 
Sjef BosmanGroupware ConsultantCommented:
Ehhh, what's the difference?? Or hadn't you seen Shuboarder's post when you posted? Or did you Submit before applying changes?
0
 
Sjef BosmanGroupware ConsultantCommented:
Did you follow the link I posted? Is it any help?

You could apply a small change, whether it will help I can't predict:

     Set db= ns.CurrentDatabase
     Set view= db.GetView("amview2")
     view.AutoUpdate= False
     Set doc= view.GetFirstDocument
0
 
shuboarderAuthor Commented:
Yes, I looked at that link Sjef...doesn't mean much to me I'm afraid.

I've applied the small change you posted above.

Still no joy.

but... I'm thinking now, what should the document selection be in the agent?
0
 
Sjef BosmanGroupware ConsultantCommented:
Nothing, or None, or what option is there to select no document at all? It uses a view to work on.

Is the database already full-text indexed??
0
 
shuboarderAuthor Commented:
Ok, I had something in there....

Now I get "Variant Does not contain an object"

As for your second question....how can I tell?
0
 
Sjef BosmanGroupware ConsultantCommented:
The error message is strange, for an agent that used to work. I assume one modification too many... ;) Most likely you accidentally modified the name of a variable. In the Option section, add
    Option Declare

Then try to save. Variables used but not declared will be flagged.

Whether a database is FT-indexed, you can find on the Database Properties window, the tab with the magnifying glass. If only Create Index is in black, and there are no other data visible, there is no FT-index. It will cost in between 20 Mb and 200 Mb to have one. Just checked: a mail database of 50 Mb with 800 documents has 500 Mb FT-index (due to the many attachments)! A production database of 800 Mb with 65,000 documents has a FT-index of just 176 Mb. If that waste of space can be justified, or if you might need advanced searches in your database in the future, then create the FT-index and try the agent again.
0
 
shuboarderAuthor Commented:
Ok, added option declare....

This threw up a script error which pointed to this line:

Set doc= dc.GetNextDocument(doc)

now changed to:

Set doc= view.GetNextDocument(doc)

Problem solved! - No idea how that slipped in there...

It was also in Madheeswar's revised code which looked exactly the same! - Neither of us spotted it!
0
 
Sjef BosmanGroupware ConsultantCommented:
And the agent's original problem? Also solved? Naaaah, can't be, not without the FT-index... ;)
0
 
marilyngCommented:
Glad you solved it!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now