A simply question: Edit some documents and save

Hi,Simple question: I have a Notes Database with some documents inside. I want to open some of then and put them as Edit mode then save. Actually I don’t edit any content, just enter the Edit mode and save/exit.

So I wrote an agent with command inside:

@Command( [EditDocument] );

@Command([FileSave]);

@Command( [CloseWindow] );

SELECT @All

For the agent properties, I selected “Shared” (not “Private”), Trigger “On Event”, Runtime is “Action menu selection” and Target is “All selected documents”. Nothing special.

However, when I open the database, and select several documents, run this agent, I got the error “@Command and other UI functions are not allowed with this search type; please select ‘None’ as your runtime target.”.

Can someone give me the idea? Thanks.

Subject: A simply question: Edit some documents and save.

Ann,

Use LS instead of formula language.

In either case, you have to loop in your code and then use NONE as your runtime target. It’s considered a bad kind of self-referencing loop otherwise.

This has been true since R4 was introduced with LotusScript’s ability to loop within the code.

regards,

raphael

Subject: RE: A simply question: Edit some documents and save.

I can use other language to implement the function, but I want to know where/which the command is wrong. Any advice?

Subject: RE: A simply question: Edit some documents and save.

All of these @Commands are for use in a document in the front end. You would not use any of them in an agent.

If your aim is to refresh the values of all the fields for a document then create a view that contains all the documents that you wish to refresh and use @Command( [ToolsRefreshAllDocs] )

An example of changing a field in an agent would be

FIELD Status := “New Value”;

You would not use any of

@Command( [EditDocument] );

@Command([FileSave]);

@Command( [CloseWindow] );

Subject: RE: A simply question: Edit some documents and save.

Thank you Matt. I begin to understand it.