Agent to Refresh Notes Documents

I have a lot of Notes documents that have a computed field in them. I need these documents to be refreshed daily to reflect changes in the computed field.

Is there any way that you can run an agent to refresh all the documents in a particular view? Or to select a bunch of documents and refresh them ? I can’t seem to find any way of doing it apart from manually.

Thanks.

Subject: Re: Agent to Refresh Notes Documents

Hi,Create a scheduled agent which runs daily and use the refresh method (Call notesView.Refresh)on the view on which you want to refresh the documents

Subject: agent

Don’t think that’ll work…

The safest thing to do is create a scheduled agent to run which recalculates the field. This can be a formula agent set to run on all docs (with a document selection if needed) that sets the field, using the same formula as the computed field.

Subject: I’m with Dan…

  • Make an Agent that runs on selected documents for testing, then change it to scheduled when it’s working. Just remember to give it a View or some such to iterate over when you switch over. (grin)

Hope this helps…

Subject: …still no joy

Tried the above suggestions, for which I’m very grateful, but still no luck…

I’ve got a Formula Agent.

Document Selection : Just chooses the form (using Simple Action)

Action :

SELECT @All;

@SetField(RunningHrsTotal;

@If(@IsNull(RunningHrs);null;@DbLookup(“”:“NoCache” ;“”:“”;“Running Hours”;RunningHrs;2 )))

The agents runs through the 9000 or so documents and says they’ve all been updated, but the views still don’t reflect the changes in the document until I open and close the documents. Driving me mad !

Subject: you are missing FIELD keyword in your code.

I think your code needs to be something like the following to work:

SELECT @All;

FIELD RunningHrsTotal:=RunningHrsTotal;

@SetField(“RunningHrsTotal”;

@If(@IsNull(RunningHrs);“”;@DbLookup(“”:“NoCache” ;“”:“”;“Running Hours”;RunningHrs;2 )))

(sorry, I am old school for null = “”; clever style, though. Also, it may be that the quotes around the field name in your @setfield is enough, but I am use to seeing FIELD fieldname:=fieldname as habit).

-Kyle Huang

Subject: Magic, thanks

I do believe that did the trick. Thanks Kyle!

Subject: yw…

No problem.

I usually go with a different style, though. I think the following does the same thing:

SELECT @All;

tmp:=@DbLookup(“”:“NoCache” ;“”:“”;“Running Hours”;RunningHrs;2);

FIELD RunningHrsTotal:=

@If(@IsNull(RunningHrs);“”;

@iserror(tmp); “”; tmp))