I have documents that I need to change with an agent. A field was added that pulls data from another form in the same database. The field is computed. This is used to sort the docs. The problem is that the older docs do not have a value in this field. I want to write a agent that will replace the value of this field with the value of the field in another form.
What is the way to do this?
Thanks
Subject: Help with agent
Here is how I would do it:
As it’s something I expect to only do once I would create an agent (shared) run from Menu (all documents in the database)
It would be a @functions:
@If( Form = “TheForm”; “”; @return(“”) );
@if( @Trim(FieldToSet) = “”; “”; @Return(“”) );
Field FieldToSet := @FormulaYouHaveForComputedField;
I would normally then create a temp view to show all the documents I want to change (same sort of thing as the first 2 lines in the agent) and then Control A to select all and then run the agent.
The first two lines in the agent are to protect mysefl from accidentially updating other documents.
Subject: RE: Help with agent
Even if this just is a one-time process, I would probably just (temporarily?) add a view action with @Command([ToolsRefreshSelectedDocs]) or @Command([ToolsRefreshAllDocs]), depending on how many documents there are and what views you have.
Might be less efficient, but should work just OK for the average lazy programmer.