Domino 9 und frühere Versionen > Entwicklung

Dokumentenhistorie

(1/3) > >>

Gallier:
Hallo @All!

Bin neu hier und fast genauso frisch in Notes. Nach dem Motto "mach mal eben" habe ich den Auftrag gewonnen in einer gegebenen Maske Felder unterzubringen, die die Historie des Dokuments wiedergeben.

Ziel: Wer, hat was, wann geändert?

Dieses soll laufend fortgeschrieben werden.

Wer weiß Rat!

Die spinnen die Römer!

Gruss
Gallier

Christopher:
Möchtest Du wissen welches Feld bearbeitet worden ist oder genügt es wer das Dokument bearbeitet hat?

Erstelle ein Feld "sÄnderungshistorie" Text Berechnet mit folgender Formel:

@If(@IsDocBeingSaved & !@IsNewDoc;
                   "Geändert durch "+@Name([CN];@UserName)+ " am "+@Text(@Now)+@NewLine+sÄnderungshistorie;"")

Christopher:
Ha das Thema hatten wir doch schon mal:

http://www.atnotes.de/cgi-bin/yabb/YaBB.pl?board=002-2;action=display;num=1016886449;start=17

luna:
hallo christopher,

ich hab mir das jetzt mal alles vorgenommen, und ich brauche das auch oft. ich hab in einer DB auch schon eine history, die das erfasst, mit script allerdings. jedoch ist da ein mussfeld drin, da muss derjenige welche auch reinschreiben, was er getan hat. das ist fuer die user aber immer ziemlich laestig, weil oben klicken sie an und unten muessen sie im prinzip nochmal reinschreiben, was sie oben getan haben.

gibt es zu der history formel noch die moeglichkeit, festzustellen, welches feld der user in was geaendert hat?

gruss,
daniela

eknori:
Moin,

hab hier was gefunden:

Here is a Lotusscript method for determining if a change has been made on a document. The basic concept is that at specific points (Open, Edit, Save, etc.) the values of all items on a document are captured into a global list. Then when saving the document a comparison of the previously captured items and values can be made with the current document items and values in order to determine what has changed. Originally I had implemented this using dynamic arrays to hold the item names and values... then I discovered that Lists were much more efficient and reduced the amount of code and processing time significantly.
      
'Add the following line to the forms Global (Declarations)
Public ItemValues List as string

'The next step is to add code to record the initial item values.
'(1) When the form is first opened in the forms PostOpen event...
Call RecordItemValues(Source)
'(2) When the form is switched from Read to Edit in the QueryModeChange event...
Call RecordItemValues(Source)
'(3) And when the form is saved at the end of the QuerySave event...
if DocHasChanged(Source) then
' further change handling
end if
Call RecordItemValues(Source)

Sub RecordItemValues(Source As NotesUIDocument)

' Record the current values of all items on the document.
Dim doc As NotesDocument
Set doc = source.Document

Forall i In doc.items
itemValues(Ucase(i.Name)) = i.Text
End Forall

End Sub

'Here is the code that makes the comparison and determination that anything has changed...

Function DocHasChanged(Source As NotesUIDocument) As Integer

Dim doc As NotesDocument
Set doc = Source.Document

DocHasChanged = False

' Catch the 'List Item Does Not Exist' Error (In case a new item was added to the document)
On Error 120 Goto newitem

If Not source.IsNewDoc Then ' Don't check new documents
' Step through each item on the document
Forall i In doc.items
nm$ = Ucase(i.name)
If nm$ <> "$REVISIONS" And nm$ <> "$UPDATEDBY" And nm$ <> "SAVEOPTIONS" Then ' Filter out specific fields
vl$ = itemValues(nm$)
If vl$ <> i.Text Then
' We have a change.
DocHasChanged = True
' In this case we want to report the change and stop... you could just as easily replace the two ' lines below with other processing code such as recording the changes to a history field, etc.
Msgbox "Change.... Field: " & nm$ & " From:" & vl$ & " To: " & i.Text & "."
Exit Forall
End If
End If
End Forall
End If

Exit Function

newitem:
' This item is new
vl$ = ""
Resume Next

End Function

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln