Working with documents
Perhaps the majority of agents in an application are intended to manipulate one or more documents. On the Web, agents can be invoked by clicking buttons or hotspots on forms or pages. @Formulas coded to launch agents can take several forms, including these. The second example illustrates how to open an agent with a constructed URL.
@Command([ToolsRunMacro];"(TestAgent1)") @URLOpen("/"+@WebDbName+"/TestAgent1?OpenAgent")
Agents are commonly run also as a result of loading or saving a document. Formulas in the WebQueryOpen
and WebQuerySave
form events determine which agents run at these points.
Topics in this section address issues related to creating agents to work with forms and documents on the Web.
Use WebQuerySave
After a web form is submitted, but before the document is actually saved into the database, an agent named in an @formula in the form's WebQuerySave
event runs. If an agent is not invoked in this event, then no agent runs.
Code the WebQuerySave
event as in...