Domino 9 und frühere Versionen > ND7: Entwicklung

Problem mit Konfliktdokumenten.... BITTE DRINGEND HILFE

<< < (2/3) > >>

C_T:
schonmal danke für eure mühe aber bisher hab ich immernoch das selbe Problem.

Hier nochmal der COde erneut überarbeitet



--- Code: ---Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase
Set db = session.CurrentDatabase

Dim doc As NotesDocument
Set doc = source.Document

Dim uidoc As NotesUIDocument
Set uidoc=source

doc.saveoptions=0

Call doc.Save(True,False)
Call uidoc.Refresh

If doc.Tabelle(0) = "0" Then
Call Tabelle(doc,workspace,session)

doc.Tabelle = "1"

Call doc.Save(True,False)
Call uidoc.Close

Set uidoc = workspace.EditDocument(True,source.Document)
Else
doc.RemoveItem("SaveOptions")
End If

doc.Tabelle = "0"

Call doc.Save(True,False)

Call uidoc.refresh
End Sub

--- Ende Code ---






--- Code: ---Sub Tabelle(doc As NotesDocument,workspace As NotesUIWorkspace,session As NotesSession)
REM Normale Deklaration
Dim db As NotesDatabase
Set db = session.CurrentDatabase

Dim richStyle As NotesRichTextStyle
Set richStyle = session.CreateRichTextStyle

Dim view As NotesView
Set view = db.GetView("aFehler")

Dim doc2 As NotesDocument
Dim entry As NotesViewEntry
Dim vc As NotesViewEntryCollection
Dim dc As NotesDocumentCollection
Dim anhange As NotesRichTextItem

REM \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     CODE     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/     \/

Set rtbody = New NotesRichTextItem(doc, "RTFELD")
Call CorrectItemRemove(doc,"rtFeld")
Set rtbody = New NotesRichTextItem(doc, "RTFELD")

Call view.Refresh

If view.EntryCount > 0 Then
Set vc = view.GetAllEntriesByKey(doc.PName(0))
Set entry = vc.GetFirstEntry
End If

If Not entry Is Nothing Then
Set doc2 = entry.Document

Do Until doc2 Is Nothing
Call rtbody.appendtext(doc2.Created)
Call rtbody.AddTab(1)

richStyle.Bold = True
Call rtbody.AppendStyle(richStyle)
Call rtbody.AppendText(doc2.Subject(0))
richStyle.Bold = False
Call rtbody.AppendStyle(richStyle)

Call rtbody.AddNewline(1)
Call rtbody.AddTab(3)
richstyle.Italic = True
Call rtbody.AppendStyle(richStyle)
Call rtbody.AppendText(Cstr(doc2.Autor(0)))
richstyle.Italic = False
Call rtbody.AppendStyle(richStyle)
Call rtbody.AddNewline(2)
richStyle.Bold = True
Call rtbody.AppendStyle(richStyle)

Call rtbody.AppendText("Fehlerbeschreibung:")
richStyle.Bold = False
Call rtbody.AppendStyle(richStyle)
Call rtbody.addnewline(1)
Call rtbody.AppendText(doc2.Fehler(0))
Call rtbody.AddNewline(2)
richStyle.Bold = True
Call rtbody.AppendStyle(richStyle)
Call rtbody.AppendText("Fehlerbehebung:")
richStyle.Bold = False
Call rtbody.AppendStyle(richStyle)
Call rtbody.addnewline(1)
Call rtbody.AppendText(doc2.Loesung(0))

Set Anhange = doc2.GetFirstItem("Anhange")
If Not Isempty(anhange.EmbeddedObjects)  Or Not (doc2.anhange = "" Or doc2.anhange = " ") Then
Call rtbody.AddNewline(2)
richstyle.FontSize = 8
richstyle.Underline = True
Call rtbody.AppendStyle(richStyle)
Call rtbody.AppendText("Anhänge:")
richstyle.FontSize = 10
richstyle.Underline = False
Call rtbody.AppendStyle(richStyle)
Call rtbody.AddNewline(1)
End If

Call rtbody.AppendRTItem(Anhange)

Set entry = vc.GetNextEntry(entry)
If Not entry Is Nothing Then
Call rtbody.AddNewline(1)
Call rtbody.AppendText("-------------------------------------------------------------------------------------------------------------------------------------------------------")
Call rtbody.AddNewline(1)
Set doc2 = entry.Document
Else
Set doc2 = Nothing
End If
Loop
End If

End Sub
--- Ende Code ---





Axel:
Verwende zum Reopen des Dokumentes mal die Funktion aus diesem Thread: http://atnotes.de/index.php?topic=25978.msg165896

Ich bin mir nämlich nicht ganz sicher ob dein Weg so der richtige ist.


Axel

flaite:
Das ist ein traditionell frickliges Problem in Notes.
Keine Zeit, mich da jetzt groß reinzudenken, aber durch ein schnelles Googlen in einer Testpause hab ich diesen Beitrag von Andre Girard gefunden (der Mann ist Entwickler bei Lotus und schreibt sehr gute Beiträge in The View)

http://www-10.lotus.com/ldd/nd6forum.nsf/0/dd507a5be7cc2e4285256eec005f56ef?OpenDocument

C_T:
hm habe mal den code von axel ausprobiert jedoch läuft das mit dem acuh nicht wirklcih ich kriege immernoch die anfrage auf speicherkonflikt?


HILFE

pete_bla:
Hi,

hängt wohl damit zusammen, dass du nicht wirklich das "Backend-Dokument" neu geladen vorliegen hast.

Ich weiss zwar nicht, wie dein Code mittlerweile aussieht, aber im bisherigen muss der "reopen" nach dem doc.save() erfolgen!

--- Code: --- doc.Tabelle = "0"

Call doc.Save(True,False)
' hier der reopen
Call uidoc.refresh

End Sub

--- Ende Code ---

Anderer Ansatz:
Pack den code in den QueryOpen.
Dann brauchtst du den reopen eventuell nicht.

Gruss Pete(r)

----------- so noch ein nachtrag:
wenn dein code immernoch so ist:

--- Code: ---
Set uidoc = workspace.EditDocument(True,source.Document)
Else
doc.RemoveItem("SaveOptions")
End If

doc.Tabelle = "0"

Call doc.Save(True,False)

Call uidoc.refresh
End Sub

--- Ende Code ---

ist der Fehler, dass Du nach dem

--- Code: ---Set uidoc = workspace.EditDocument(True,source.Document)
--- Ende Code ---
noch ein save auf das Hintergrund-doc machst:

--- Code: ---Call doc.Save(True,False)
--- Ende Code ---
ich glaub Dir ist da die End if verrutscht:

--- Code: ---    Else
doc.RemoveItem("SaveOptions")
    ' nicht hier: End If

doc.Tabelle = "0"

Call doc.Save(True,False)

Call uidoc.refresh
    End If ' sonder hier

--- Ende Code ---
aber ein paar der doc.save's kannst du sicher noch weglassen....

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln