Domino 9 und frühere Versionen > ND6: Entwicklung
EditDocument --> Ungültiges oder nicht vorhandenes Dokument
C_T:
@Bernhard,
Warum das 3 Agenten machen, folgendes: Die anderen beiden Agenten die ausgeführt werden sind durch fremdfirma erstellte Agenten an die ich möglichst wenig bzw. gar nicht dran rumfummeln will.
@Dau-In
ich habe mir in nem Print für DL und AU jewils die DOCUNIDS ausgeben lassen und die erscheinen auch i der ausgabe. und das Doc ist deklariert nur wieder vergessen hatte gestern irgendwie Keinen plan mit gar nichts mehr.
Anbei ein neuer Code indem jetzt hoffentlcih nichts fehlt.
[BUTTON]
--- Code: ---@Command([FileSave]);
@Command([RunAgent];"[AGENT1]"); REM {Dieser erstellt DocB};
@Command([FileSave]);
@Command([RunAgent];"[AGENT2]");REM {Dieser erstellt DocC};
@PostedCommand([RunAgent];"[AGENT3]");REM {Dieser ändert die Felder siehe unten};
--- Ende Code ---
[AGENT3]
--- Code: ---Sub Initialize
On Error Goto ERRORSTEP
Print "ZUSATZAGENT"
REM Umgebung
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
REM Standard
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim DL As NotesDocument
Dim AU As NotesDocument
Dim AUDB As NotesDatabase
Set AUDB = session.GetDatabase(db.Server,[DB])
Set DL = AUDB.GetDocumentByUNID(doc.GARefUNID(0))
Print "DL = " + Cstr(DL.UniversalID) 'hier erscheint auch wirklich ne DOCUNID
Set AU = AUDB.GetDocumentByUNID(DL.AufDocUNID(0))
Print "AU = " + Cstr(AU.UniversalID) 'hier erscheint auch wirklich ne DOCUNID
AU.XX_EBDocUNID = DL.EBDocUNID(0)
doc.XX_AufDocUNID = DL.AufDocUNID(0)
doc.XX_FELD1 = Cstr(session.CommonUserName)
doc.XX_FELD2 = "[TEXT]"
doc.XX_FELD3 = "[TEXT]"
doc.AAName = AU.AufName(0)
doc.AANr = AU.AufNr(0)
doc.AADocUNID = AU.AufDocUNID(0)
If AU.LNR(0) <> "" Then
DL.LNR = AU.LNR(0)
doc.LNR = AU.LNR(0)
Else
Dim Profil As NotesDocument
Set Profil = db.GetProfileDocument("[MASKE]")
If Profil Is Nothing Then
Messagebox "Profildokument nicht gefunden --> Abbruch"
Else
Dim LNRS As String
LNRS = Profil.X_JZ(0) + Profil.X_JZT(0) + Cstr(Profil.X_LNR(0))
doc.LNR = LNRS
DL.LNR = LNRS
AU.LNR = LNRS
Profil.X_LNR = Profil.X_LNR(0) + 1
Call Profil.Save(True,False)
End If
End If
Print "AU2 = " + Cstr(AU.UniversalID) 'hier erscheint auch wirklich ne DOCUNID
Set uidoc = workspace.EditDocument(True,AU,,,,False) '<--------- HIER IST DER FEHLER bzw. HIER KOMMT DIE MELDUNG
Call uidoc.Save
Call uidoc.Close
Print "DL2 = " + Cstr(DL.UniversalID)
Set uidoc = workspace.EditDocument(True,DL,False,,True,False)
Call uidoc.Save
Call uidoc.Close
Set uidoc = workspace.EditDocument(True,doc,False,"","",False)
Call uidoc.Save
Exit Sub
ERRORSTEP:
Const Teilbereich = ""
Msgbox "Es ist ein Fehler aufgetreten." & Chr(10) & Chr(10) _
& "Teilbereich: " & Teilbereich & Chr(10) _
& "Fehlermeldung: " & Error$ & Chr(10) _
& "Fehlernummer: " & Err & Chr(10) _
& "Codezeile: " & Erl & Chr(10) _
,64,"Error"
Print "Teilbereich: " & Teilbereich & " - " & Cstr(Error$) & " - Nr: " & Cstr(Err) & " - Zeile: " & Cstr(Erl)
Exit Sub
End Sub
--- Ende Code ---
So dies ist eigentlcih der exakt kopierte COde aus meinem Agenten
Hoffe euch fällt was ein.
TRO:
... nur mal so ins Blaue ...
welches Form-Item hat das (Backend-) Doc "AU" und gibt es diese Maske wirklich in der DaBa?
Thomas
C_T:
jep gibt es, es gibt alle 3 masken und auhc alle 3 dokumente
C_T:
Entschuldigt das ich nochmal pushe aber hat hier jemand noch ne Idee???
ata:
... welche Eigenschaften hat dein Agent - nicht überall funktionniert NotesUIWorkspace
Toni
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln