I am trying to create Newsletter agent I don’t want to use the simple action only because I need to add conditions. I have created two agents one that uses the simple action called E-Mail and the other with the condition. This is my code
What’s the trigger for your invoking agent? Based on the SELECT @ALL at the end of the code, I presume the agent is set to run on selected documents? If that’s the case, your code won’t work because it includes an @Command. Per Designer Help (my emphasis):
Formula-based agents run iteratively on the documents in the database, unless you select None in the agent’s target option. You can also apply search criteria through the agent interface to specify which documents in the database are to be processed. A SELECT statement in the formula further limits the search. If you do not include a SELECT statement in the formula, Domino Designer appends a “SELECT @All” statement. Except for “SELECT @All,” a SELECT statement must be the first statement in the formula to be effective.
@Commands are only allowed in agents that specify None in the target option.