Trouble with Agent to flag all documents

Hello,

I have a database with documents that utilize 2 types of forms. I want my agent to go through all the documents and check the data in a field. Depending on that field, I want to modify the hidden archive field.

I have written the following formula language. The agent’s target is set to “All documents” and the document selection is pointed to the form these fields apply to. The agent is also set to “Modify documents”. Can anyone see where I’m going wrong? When I run this agent from the menu, it says No Documents found. There are quite a few documents with the below criteria. Thanks in advance!

FIELD ch_year := ch_year;

FIELD archived_chg := archived_chg;

@If( (ch_year = “2004”); @SetField(“archived_chg”; “1”); “”);

SELECT @All

Subject: Trouble with Agent to flag all documents

I can’t see anything wrong with your formula. That said, the “No Documents Found” message is more likely to arise from a problem with the Document Selection rather than the formula. What exactly is in the Document Selection part of the agent?

Cheers

Alan