Hi,
I have 4 forms which calls one single shared action ‘save & close’. The action contains code to check which form and then based on that call agent.
@if(Form=“CCLMU”;@command([toolsrunmacro];“agent1”);";@command([toolsrunmacro];“agent2”))
Each agent contains formulas which checks for required fields and then allows it to save the form. When I click the action button is says ‘The document has not yet been saved’.
And other funny thing is that in local is works prefectly as expected but not when in server. Any suggestions would be helpful.
Subject: RE: Calling Agent from Action failed
Agents that run on selected documents, can’t be run on a document that has not yet been saved. The Form field also doesn’t normally have a value until you save the document for the first time.
This is not a good way to do validations. The user can bypass your save action by pressing Ctrl+S. You must use validation formulas in the fields, or the Querysave event.
To avoid duplicating code, read about script libraries.
Subject: Calling Agent from Action failed
Morning,
@commands just allowed in UI. Thats the reason why they don´t work on Server.
I´m wondering about your Agents. When the user press Control + S , then no agent will start.
Why don´t you code in the QuerySave Event your Agents ?
Then it doesn´t matter how the documents will be saved…
regards Bernhard