我是Lotus筆記中的初學者。我有一個關鍵字查找表單和一個編輯歷史字段。每個更改都記錄在編輯歷史記錄字段中。如下圖所示,顯示的編輯歷史:蓮花筆記:如何按降序對多值字段進行排序
日期:2016年2月10日 USER:(名) FROM:關鍵字:關鍵字值 TO:關鍵字:關鍵字值
日期:2016年5月29日 USER:(名) FROM:關鍵字:關鍵字值 TO:關鍵字:關鍵字值
的編輯歷史追加的是降低之前的編輯,以便按升序顯示。如何按降序對編輯歷史進行排序?或者是否可以在先前的編輯歷史記錄上插入新的編輯歷史記錄以使其按降序排列?如果是的話,我該怎麼做?預先感謝您的幫助。 :)
在我EditHistory多值字段,我有這樣的代碼:
@If(@IsDocBeingLoaded & @IsNewDoc; @Return(""); @True);
@If([email protected]; @Return(@Sort(EditHistory;[Descending]));
@Trim(@Subset(@Sort(EditHistory;[Descending]) ; -100)))
在聲明:
Dim FieldValues() As String
在我的表單中我有這些:
Sub EditHistorylist
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim source As NotesUIDocument
Dim fieldnum As Integer
Dim entry As String
Dim histo As Variant
Set source = workspace.CurrentDocument
For fieldnum = 0 To Ubound(FieldValues)
If FieldValues(fieldnum,1) <>source.fieldgettext(FieldValues(fieldnum,0)) Then
entry = Chr(10) + "DATE:" + Date$+Chr(10)+ "USER:" + session.CommonUserName +_
Chr(10)+ "FROM:" + FieldValues(fieldnum,0) + "::" + FieldValues(fieldnum,1)+_
Chr(10)+ "TO:" + FieldValues(fieldnum,0) + "::" + source.fieldgettext(FieldValues(fieldnum,0)) +_
Chr(10) + Chr(95) + Chr(95) + Chr(95)
Call source.FieldAppendText("EditHistory",Chr(10)+entry)
End If
Next
End Sub
文檔事件:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
If Not Source.IsNewDoc Then
Call EditHistorylist
End If
End Sub
Sub Postmodechange(Source As Notesuidocument)
'build array of current values
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim form As NotesForm
Dim fieldnum As Integer
Dim counter As Integer
Set db = session.CurrentDatabase
Set doc = Source.Document
Set form = db.GetForm(doc.Form(0))
fieldnum = Ubound(form.fields)
Redim FieldValues(fieldnum,1)
counter = 0
Forall field In form.fields
FieldValues(counter,0) = field
FieldValues(counter,1) = source.fieldgettext(field)
counter = counter + 1
End Forall
End Sub
告訴我們的代碼,您使用寫的歷史,那麼我們就可以說明如何修改方向...沒有代碼,沒有幫助! –
在我的EditHistory多值字段中,我有這個代碼 @If(@IsDocBeingLoaded&@IsNewDoc; @Return(「」); @True); (@Sort(EditHistory; [Descending])); @Trim(@Subset(@Sort(EditHistory; [Descending]); -100))) –
聲明中: Dim FieldValues()作爲字符串 在我的表單中我有這些: 子EditHistorylist \t昏暗的會議作爲新NotesSession \t昏暗的工作區作爲新NotesUIWorkspace \t昏暗源作爲NotesUIDocument \t昏暗fieldnum作爲整數 \t昏暗的條目作爲字符串 \t Dim histo As Variant \t \t集源= workspace.CurrentDocument \t \t 對於fieldnum = 0至UBOUND(FieldValues) –