3

i have this piece of function..and i want to add a new line to mVal every time before adding mWrkFlwDoc.workFlow(0)

Function workFlowHistory() workFlowHistory=False

Dim mWrkFlwVw As NotesView
Dim mWrkFlwColl As NotesDocumentCollection
Dim mWrkFlwDoc As NotesDocument
Dim mVal As String

Set mWrkFlwVw = gDB.GetView("lkpWorkFlow")
Set mWrkFlwColl = mWrkFlwVw.GetAllDocumentsByKey(gDoc.empName(0),True)
Set mWrkFlwDoc = mWrkFlwColl.GetFirstDocument

mVal = ""

Do While Not mWrkFlwDoc Is Nothing
    If mWrkFlwDoc.documentID(0) = gDoc.documentID(0) Then
        ***mVal =mVal+ mWrkFlwDoc.workFlow(0)*** ' add new line before adding mWrkFlwDoc.workFlow(0)

    End If
    Set mWrkFlwDoc = mWrkFlwColl.GetNextDocument(mWrkFlwDoc)
Loop
gDoc.workFlowHistory = mVal
gDoc.save True,True
workFlowHistory=True

End Function

i read about AddNewLine method but it inserts new lines in a rich text item....how can i go about it with string datatype, text field?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Bebo
  • 129
  • 2
  • 12

1 Answers1

6

A multi-value field can be used here. To do that you need to create an array and put each new entry in the array, inside the loop. The field(s) on the form can be set to show each value on a new line.

If you do not want to use a multi value field, just add a Chr(13) for each new line.

Jasper Duizendstra
  • 2,587
  • 1
  • 21
  • 32