It usually is no good idea to use simple action agents. The code is clearer and better readable, if you use formula- agents instead. If you are not able to write a formula agent, then: Stop working with the designer as you might mess up everything and cannot repair it.
The formula for setting a field in a document (or all selected documents, depends on the target of the agent) is:
FIELD NAME := "text is replaced"
This agent will replace the item with name "NAME" in all selected documents with "text is replaced"
To call the agent from a view action or a form action or from wherever, you again need Formula (as stated in the comment by Knut):
@Command([RunAgent]; "agentName")
Knowing the formula language is the minimum you need to know as a IBM Notes / Domino Developer.