I have an agent with this formula:
FIELD AssignContact:=@PickList( [Custom];“”;“Users”;“User List”;“Choose a User to Assign”;1);
FIELD AssignorContact:=@Name([CN];@UserName);
@Command([ViewRefreshFields]);@All
Target is set to none
When I select multiple documents, and try to run the agent, it will only run on one document (the last selected one) and not on all the selected ones. How do I get it to run on all selected docs?
Thanks in advance for your input.
Helen
Subject: Agent won’t run on selected docs
By changing the target from “None” to “All selected documents” – but then you can’t use the picklist in a formula agent. You’d need to separate it out into two – one with a target of “None” that does the picklist and sets an environment variable, and another that uses the environment variable to change the documents.
Subject: RE: Agent won’t run on selected docs
Stan,Thank you for your quick response. I don’t have a clue about writing agents, can you explain how I can split it in two? do you mean create 2 agents? if so, how do I set the first agent to invoke the second?
This is somebody else’s db that I am trying to fix and really don’t know what I am doing.
Thanks again.
Helen
Subject: RE: Agent won’t run on selected docs
That’s right, it needs to be two agents. The first one (the one with target=“None”) just does the @Picklist to get a value, then @Environment to put the value into the notes.ini. The last line of the first agent is @Command([ToolsRunMacro];“Other Agent”). The second one runs on all selected documents and uses @Environment to get the value that the user selected in the first agent, then sets the fields in the selected documents.