Autor Thema: Why this agent doesn't run ?  (Gelesen 1660 mal)

Offline Toma Bogdan

  • Aktives Mitglied
  • ***
  • Beiträge: 146
  • Geschlecht: Männlich
  • That's me ...
    • A nice site !
Why this agent doesn't run ?
« 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:
  • Run personal agents
  • Run restricted LotusScript/Java agents
  • Run unrestricted LotusScript/Java agents

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
« Letzte Änderung: 30.10.02 - 15:22:01 von Toma Bogdan »

Offline Performance

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 1.096
  • Geschlecht: Männlich
  • I love YaBB 1G - SP1!
Re:Why this agent doesn't run ?
« Antwort #1 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
Wir können alles außer hochdeutsch !

Alles ist möglich, es ist nur eine Frage der Zeit oder des Geldes!

Offline Hoshee

  • Administrator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 697
  • Geschlecht: Männlich
  • Try To Be Mensch ...
    • Syslords Solutions IT-Dienstleistungen
Re:Why this agent doesn't run ?
« Antwort #2 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
Detlef

-> Syslords Solutions
*************************************
Wer dem Chef in den Hintern kriecht, muß damit rechnen, daß er ihm eines Tages zum Hals heraushängt

Offline Toma Bogdan

  • Aktives Mitglied
  • ***
  • Beiträge: 146
  • Geschlecht: Männlich
  • That's me ...
    • A nice site !
Re:Why this agent doesn't run ?
« Antwort #3 am: 31.10.02 - 07:43:42 »
I wrong when I write the code .... but it doesn't works with this modification.....  :o

Offline Toma Bogdan

  • Aktives Mitglied
  • ***
  • Beiträge: 146
  • Geschlecht: Männlich
  • That's me ...
    • A nice site !
Re:Why this agent doesn't run ?
« Antwort #4 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 ?
« Letzte Änderung: 31.10.02 - 08:01:17 von Toma Bogdan »

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz