Agent question

if there are 2 agent scheduled on event “after new mail has arrived” how can I make sure one always runs on new mail before the other one? first agent (formula base) is modifying all new messages and second (script)is forwarding I just want to make sure that 2nd agent does not forward messages until they are modified by first one.

Subject: RE: agent question

Have the first agent call the second at the end of the code

Subject: I’m not a developer

how would I do this in first agent if first me is using @formula ?

Subject: Code inside

@Command([ToolsRunMacro];“Your agent name here”)

Subject: ok so here is my agent formula

FIELD Subject := “addition to subject line goes here” + Subject + “…”;SELECT @All

@Command([ToolsRunMacro];“my_next_agent_name”)

if I try to save this after adding @Command([ToolsRunMacro];“my_next_agent_name”)I get "an operator or semicolon was expected but none was encountered: ‘)’

what I’m doing wrong?

Subject: probably need to add the semi-colon

That means new line and you need a new line after the @select:

FIELD Subject := “addition to subject line goes here” + Subject + “…”;

SELECT @All; (add semi-colon here)

@Command([ToolsRunMacro];“my_next_agent_name”)

Subject: what’s wrong with this?

if I remove @Command([ToolsRunMacro];“my_agent_name”)

agent run just fine, and it does modify subject line according to

FIELD Subject := "addition to subject line " + Subject + “…”;

SELECT @All

but if I add

@Command([ToolsRunMacro];“my_agent_name”)

after SELECT @ALL;

it does not do anything???

if I run it manually it says found one doc matching criteria but does not do anything nither modify subject line nor trigger second agent, why?

Subject: This is your current probem (but I don’t think you will succeed)

The select all should be the last line, so it would read like the following:

FIELD Subject := “addition to subject line goes here” + Subject + “…”;

@Command([ToolsRunMacro];“my_next_agent_name”)

SELECT @All

However, the @Command (any one, there is several) can most likely not get triggered ta all in this context.

I think you should modify the Lotus Script agent to do additionally what this agent does, too. And you are probably save a lot of time, if you pay someone with development skills - this is most likely something very simple.

Subject: something a bit like this

Sub Initialize Dim session As New notessession

Dim db As notesdatabase

Dim col As notesdocumentcollection     

Dim doc As notesdocument		

Set db = session.currentdatabase	

Set col = db.unprocesseddocuments		

Set doc = col.getfirstdocument	

Do Until doc Is Nothing

doc.Subject = “ addition to subject line goes here “ + doc.Subject(0)	(or whatever)

then use the forwarding code in the second agent here



Call doc.Save(False,False)		

Set doc = col.getnextdocument(doc)     

Loop

End Sub