Domino 9 und frühere Versionen > Administration & Userprobleme

Why this agent doesn't run ?

(1/1)

Toma Bogdan:
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:
[*]Run personal agents
[*]Run restricted LotusScript/Java agents
[*]Run unrestricted LotusScript/Java agents
[/list]

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

--- Ende Code ---

Performance:
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

Hoshee:
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

Toma Bogdan:
I wrong when I write the code .... but it doesn't works with this modification.....  :o

Toma Bogdan:
interesting thing.....
I create a new agent, I copied the code into it and surprise ... it works !  ::)


 Have anybody an explication for this ?

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln