Conditional WebQuerySave agents
We all know that you can run agents when a web page gets submitted, by using the WebQuerySave event of a form.
So, if your form is called resource, and you want to run an agent called "SaveResource" when it is submitted you enter the following:
However, notice that in the design pane shown it says "Enter a formula that runs an agent." This basically means that you can create any kind of conditional formula as long as it results in an @Command([ToolsRunMacro];"...") call. For example, say you wanted to only run the query save agent only if the field called "RunAgent" was set to "1". Use the following:
The possibilities are almost endless. You could use the QuerySave agent only if it a Tuesday:
@If(@WeekDay=3;
@Command([ToolsRunMacro]; "(TuesdaySave)");
@Command([ToolsRunMacro]; "(OtherdaySave)")
)
You get the idea right ?
Note: Agents that run on the web have to be set to:
Run - Manually from agents list
On - Run once (@Commands may be used)
Also, although you name agents without the parentheses i.e ResourceSave and not (ResourceSave), Notes uses these when it references them and so you need to use them in your ToolsRunMacro @command.
Multiple WebQuerySave agents
You can also execute multiple webquerysave/open agents @Command([ToolsRunMacro]; "(TuesdaySave)"); @Command([ToolsRunMacro]; "(OtherdaySave)")
Reply
you can also make it dynamic
I found that you can make the agent execution dynamic by assigning it a value from a field. @Command([ToolsRunMacro];<fieldname>)
Reply
Re: you can also make it dynamic
That's the way I do it. I set it equal to a field name and then I assign the field a value with JavaScript just prior to submitting. While you don't have to do this everytime, it works really nicely for work flow applications when you want to trigger different agents based on the condition of the document.
Reply
Re: you can also make it dynamic
Some one can help me in detail how I can use @Command([ToolsRunMacro];<fieldname>) ??
Thanks in advance,
Reply