Lotus Notes / Domino Sonstiges > Help-Desk Applikation !!Help!!

Fragen zu 1.0.10

<< < (16/16)

regedit:
@Thomas
Danke für die Hilfe.
Ich habe das script so abgeändert, wie Du es beschrieben hast.
Beim Aufruf: Call doc.remove(true) kommt allerdings die Fehlermeldung:
"Cannot remove NotesDocument when instantiated by NotesUIDocument"

Hab ich da etwas falsch gemacht???
   

Thomas Schulte:
Nein nicht wirklich. Mist da musst du dann doch noch anders vorgehen.


--- Code: ---Sub Click(Source As Button)
   
   Dim ws As New NotesUIWorkspace   
   Dim s As New NotesSession   
   Dim db As NotesDatabase
   Dim view As NotesView
   Dim doc As NotesDocument
   Dim uidoc As NotesUIDocument
   Dim docunid As String
   Dim removedoc As notesdocument
   
   Set db = session.currentdatabase
   Set doc =doc2.document
   Set doc2 = ws.CurrentDocument
   
   Call doc2.document.Save(true,false)
   Set doc =doc2.document
   docunid = doc2.universalid
   Call doc2.Send
   Call doc2.Close (True)
   
   Set removedoc = db.getdocumentbyunid(docunid)
   Call removedoc.remove(true)
           
End Sub

--- Ende Code ---

regedit:
Damit das Script ohne Fehlermeldung durchläuft, habe ich ihn so abgeändert:

Sub Click(Source As Button)
   
   Dim ws As New NotesUIWorkspace   
   Dim s As New NotesSession   
   Dim db As NotesDatabase
   Dim view As NotesView
   Dim doc As NotesDocument
   Dim uidoc As NotesUIDocument
   Dim docunid As String
   Dim removedoc As notesdocument
   
   Set db = s.CurrentDatabase
   'Set doc =doc2.Document   Fehlermldg:"Variant does not contain an object"
   Set view = db.GetView ("Helpdeskanfrage")
   Set doc2 = ws.CurrentDocument
   Call doc2.Document.Save(True,False)
   Set doc =doc2.Document
   'docunid = doc2.UniversalID Fehlermldg:"Instance member UNIVERSALID does not exist"
   docunid = view.UniversalID
   Call doc2.Send
   Call doc2.Close (True)
   Set removedoc = db.getdocumentbyunid(docunid)
   Call removedoc.remove(True)
   
End Sub

Allerdings löscht es jetzt die Ansicht und nicht das Dokument  ???

Thomas Schulte:
Du machst mich ganz konfuzius

Sub Click(Source As Button)
 
 Dim ws As New NotesUIWorkspace
 Dim s As New NotesSession
 Dim db As NotesDatabase
 Dim view As NotesView
 Dim doc As NotesDocument
Das hier ist flüssiger als Flüssig, das ist überflüssig
 Dim uidoc As NotesUIDocument
löschen das muss eigentlich so heißen:
 Dim doc2 as NotesUIDocument

 Dim docunid As String
 Dim removedoc As notesdocument
 
 Set db = session.currentdatabase
Das hier war natürlich Blödsinn. Kommt vom Kopieren
 Set doc =doc2.document
rauslöschen
 Set doc2 = ws.CurrentDocument
 
 Call doc2.document.Save(true,false)
 Set doc =doc2.document
Das hier ist so falsch
 docunid = doc2.universalid
und muss so heißen
 docunid = doc.universalid

 Call doc2.Send
 Call doc2.Close (True)
 
 Set removedoc = db.getdocumentbyunid(docunid)
 Call removedoc.remove(true)
 
End Sub


Aber das muss jetzt funktionieren.
Und ja das ist kein Wunder das er die View löscht, denn auch die View ist nur ein Dokument in der Datenbank. Allerdings ein Design Dokument.

Ich glaub ich muss meinen Disclaimer ändern.

Code is provided as is und alle Fehler sind beabsichtigt und dürfen behalten werden.

regedit:
Danke für Deine Hilfe und vor allem Deine Geduld.
Ich werde es gleich ausprobieren
und hoffe Dein Disclaimer bleibt der alte  ;D

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln