Das Notes Forum
Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: Nick am 28.10.04 - 16:52:27
-
Hallo Zusammen,
gibt es eine Möglichkeit in Lotus Script einen Agenten (Gemeinsamer Code\Agenten\agtCompose bestehend nur aus @Formeln) aufzurufen?
Ich erhalte folgende Fehlermeldung: NotesError: @Funktion ist in diesem Kontext ungültig.
Abhängig vom einem Feldwert und der Antwort des Benutzers soll ein Dokument erzeugt werden:
Sub Exiting(Source As Field)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim currentdoc As NotesDocument
Dim agent As NotesAgent
Set uidoc = workspace.CurrentDocument
Set currentdoc = uidoc.Document
Set db = session.CurrentDatabase
Set agent = db.GetAgent("agtCompose")
If currentdoc.gbInvest(0) >= 50000 Then
boxType& = MB_YESNO + MB_ICONQUESTION
If Messagebox ("Möchten Sie den Projektauftrag jetzt
erstellen?",boxType&,"Auftrag")=6 Then
'Anlegen eines Projektauftrages --> Aufruf des Agent agtCompose
Call agent.Run
End If
End If
End Sub
Agent (Der Agent ist ca. 3 Seiten vollgefüllt mit @Formulas - wenn er über Button aufgerufen wird, dann funktioniert er - nur soll er jetzt eingebunden werden. Die ganzen REMs definieren das anzulegende Dokument)
REM {CONSTANTS };
REM {WHAT TO COMPOSE - GET FLAGS };
REM {VARIABLES };
REM {---UI STRINGS---};
REM {CHECK MULTI / SHARED TASK};
REM {GET SELECTED DOCUMENT};
REM {SAVE CURRENT NEW DOC WHEN STARTED FROM UI};
REM {CREATE TYPE LIST};
REM {GET DEFAULT TYPE};
REM {FIND THE SUBFORM TO LOAD};
REM {SET FLAGS IN USERPROFILE};
REM {SET FLAG TO BLOCK THE CLICK EVENTS OF THE UNDERLAYING VIEW};
@PostedCommand( [Compose]; tForm )
Merci für jede Hilfe!!!
Ciao, Nick
-
Hi Nick.
Ich kann dir keine konkrete Antwort auf deine Frage geben.. aber ich hab irgendwo im Hinterkopf, dass es bei Formel-Agenten auf den Kontext (lokal oder am Server) und die Art (periodisch oder manuell) ankommt, in dem sie verwendet werden.
Auf die Schnelle hab ich nur eine Seite in der Designer-Hilfe gefunden: Suche mal nach:
"Wo kann man diese @Funktion anwenden? (Teil 1 L - R)"
- am Besten mit den Anführungszeichen kopieren.
Ansonsten ließ doch mal den Artikel über Agenten:
http://www.atnotes.de/index.php?board=26;action=display;threadid=16181
Vielleicht hilft dir das...
lg, alex
-
@Commands dürfen in dem Agenten nicht verwendet werden.
Aus der KBASE:
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.
Andreas