Das Notes Forum

Domino 9 und frühere Versionen => Administration & Userprobleme => Thema gestartet von: Toma Bogdan am 30.10.02 - 15:21:07

Titel: Why this agent doesn't run ?
Beitrag von: Toma Bogdan am 30.10.02 - 15:21:07
I have a mail-in database and I want to run an agent when a new mail doc arrive to this db. I created an agent with trigger "After New Mail Arrives"

I test this agent in Designer->Agent Log and it seems that the agent doesn't run when I send a mail to the address of mail-in database  !  Why the agent doesn't run ? My name is listed in all the followings server field:

this is the agent code listing:
[/color]
Code
Sub Initialize
Dim session As New notessession
Dim db As notesdatabase
Dim mail As notesdocument
Set db=s.currentdatabase
Set mail = session.DocumentContext 
If mail.HasItem( "Id" ) Then
If mail.Id(0)="" Then
   mail.ID="No"
   mail.save True, True      
End If
End Sub
Titel: Re:Why this agent doesn't run ?
Beitrag von: Performance am 30.10.02 - 19:49:28
Is the agent private or shared ?
Normally i use session.documentcontext in Web, your session.doc is emty because the property documentcontext works only with a selected or in-memory doc.

Try this: Database.UnprocessedDocuments
It takes all unprocessed doc in a collection.

cu
Titel: Re:Why this agent doesn't run ?
Beitrag von: Hoshee am 30.10.02 - 20:24:31
Yoo Toma,

in your script you declare session as notessession and after you set the db with s.currentdatabase.

correct this and it should run.

cu ...

Hoshee
Titel: Re:Why this agent doesn't run ?
Beitrag von: Toma Bogdan am 31.10.02 - 07:43:42
I wrong when I write the code .... but it doesn't works with this modification.....  :o
Titel: Re:Why this agent doesn't run ?
Beitrag von: Toma Bogdan am 31.10.02 - 07:46:13
interesting thing.....
I create a new agent, I copied the code into it and surprise ... it works !  ::)


 Have anybody an explication for this ?