This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jan 7, 2016, 3:49 PM
21 Posts

simple agent isn't working correctly..

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer
  • Tags:
  • Replies: 4

this bit of code is doing something weird.
doing the doc.putinfolder, isn't really moving the emails to the desired folder..it's creating a stub at the location and the email still remains in the inbox.
If I delete the email from the inbox..it disappears from the desired folder... this has worked just fine for 8 years, but this year, it just created stubs...
Any idea?

Here is the simple script...
 

Sub Initialize
 ' Move emails to a folder based on year. This way inbox keeps clean for this mail-in database
 ' Runs on the 2nd day of january.
 
 Dim s As New NotesSession
 Dim db As NotesDatabase
 Dim view As NotesView
 Dim lookupView As NotesView
 Dim newView As NotesView
 Dim doc As NotesDocument
 
 Dim currentYear as New NotesDateTime( Now )
 Dim item As NotesItem
 Dim i As integer
 Dim thisYear As String 
 Dim docYear As String
 
 Set db = s.Currentdatabase
 Set view = db.Getview("($Inbox)")
 
 thisYear = StrRightBack( currentYear.Dateonly, "/" )
 
 i=0
 Set doc = view.Getfirstdocument()
 While Not (doc Is Nothing)  
  
  Set item = doc.GetFirstItem ( "DeliveredDate" )  
  docYear = StrRightBack ( item.Datetimevalue.Dateonly, "/")
  
  If ( docYear = thisYear) Then
   GoTo skip
  Else   
   Call doc.Putinfolder( docYear, true )
  End If  

skip:
  i = i + 1  
  Set doc = view.Getnextdocument(doc)
 Wend
 
done: 
End Sub

 

Thanks..
(edit.. apparently used MS Edge cause double posts..sorry about that)

Jan 7, 2016, 4:55 PM
100 Posts
Not just an MS Edge problem...

I use IE and get double posts too. I contacted the site admins months ago...no change in behavior.

So the code hasn't changed in 8 years. I anything else different? New OS, Domino patch level different, anything?

Have you run the code with the debugger on to see how the code executes in the front end?

If you've done patching to Domino since the last agent run, you may want to submit a PMR to IBM, system might be borked.

Jan 7, 2016, 5:48 PM
21 Posts
up to date

Domino is fully up to date..
I didn't debug it because it so freakin simple...

​I guess I'll open a support ticket.

 

Jan 11, 2016, 6:34 AM
14 Posts
Try adding RemoveFromFolder to remove from Inbox
I have no idea why your code's behaviour would have changed, but you could try adding this line to remove the document from the Inbox after adding it to the other folder:
Call doc.RemoveFromFolder("($Inbox)")

This assumes the Inbox is a folder, which is the case if your code works on a standard Domino mail file.
Jan 11, 2016, 2:24 PM
323 Posts
I don't know what you mean by stubs, but ...a couple of thoughts.

If you need to remove something from the Inbox, I would expect to find a NotesDocument.RemoveFromFolder() call.

In the target folder -- has it been changed to show documents in hierarchy, e.g.? Because if it has, it could get tangled up when you run NotesDocument.PutInFolder() on a response doc (that is, a doc with a $Ref field).

And what's your default folder design? If it changed to a hierarchical view, that'd account for a lot.

I'd expect the partial-hierarchies switch might also have some heartburn over moving only responses to the folder, but I'm not sure exactly how it's impacted.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal