Domino 9 und frühere Versionen > Entwicklung
Agent mit Formeln aus LS ausführen
Joe:
Hallo Liebe Notes-Gemeinde,
ich habe mal wieder ein Brett vor dem Kopf. Ich möchte beim Verlassen eines Feldes einen Agenten ausführen. So weit, so gut. Im Exiting des Feldes führe ich ein call Agent.Run aus. Das Problem liegt wohl darin, dass der Agent Formelsprache enthält, denn die dann folgende Fehlermeldung ist:
Notes Error: @Funktion ist in diesem Kontext ungültig.
Der Agent soll mit @DBLookup's einen Wert aus dem NAB ziehen und in ein Feld einsetzen (FIELD:=xxxxxxx).
Warum geht das denn nicht? Der Agent alleine über das Menü aufgerufen läuft bestens. Irgendwas mache ich verkehrt oder habe ich nicht berücksichtigt. Bitte helft mir auf die Sprünge! ;-)
Glombi:
@DbLookup geht nicht - aus der KBASE:
Published
Product Area: Notes Date: 25.04.2001
Product Release: Notes Client 4.6x, Notes Client 4.5x Document #: 155913
Category: Workstation/Desktop\\Application Development\\Macro/Agent/LotusScript
Error: "@Function is Not Valid in this Context" Calling One Agent from Another via LotusScript
Problem:
When you attempt to call one agent from another using LotusScript, the following error occurs:
"Notes Error: @Function is not valid in this context."
Solution:
This error occurs when the "called agent" contains one of the following @functions:
@Command (or an @PostedCommand)
@DbLookup
@DbColumn
@DDEInitiate
@DDETerminate
@DDEExecute
@DDEPoke
@MailSend
@Prompt
@DialogBox
@PickList
The use of these functions is reserved for the Notes workspace - where they receive either input or context from a user. If you attempt to use these functions in the background, there is no opportunity for a user to provide the input the functions require.
Supporting Information:
Two Typical Scenarios.
1. From the Notes UI, you attempt to run a LotusScript agent (Agent1) that calls an another agent (Agent2), and Agent2 contains one or more of the functions listed above. The NotesAgent class Run method runs the called agent (Agent2) in the background. (In this case, the error displays in a dialog box.)
2. A scheduled agent calls another agent, and - in the called agent - the value of a field is populated using @Prompt or @PickList. (In this case, the error displays in the field.)
Du könntest versuchen, im Exiting Event den Agenten mit
@Command([ToolsRunMacro];"Agentname")
aufzurufen.
Andreas
Joe:
Sch........kleister!
Dann kann ich das automatische Füllen des Feldes wohl vergessen (sprich: einen Button mit dem Agenten neben das Feld legen und den User machen lassen)? Oder gibt's eine andere Lösung? So weit, dass ich den ganzen Agenten in LS machen könnte, gehen meine Kenntnisse leider nicht.
Glombi:
Hast Du das mit
--- Zitat ---Du könntest versuchen, im Exiting Event den Agenten mit
@Command([ToolsRunMacro];"Agentname")
aufzurufen.
--- Ende Zitat ---
schon versucht?
Joe:
Hallo Glombi,
das wäre schön, aber im Exiting-Event ist meines Wissens nur LS zulässig, kein Formel.
Joe
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln