Adding to Multi Valued Text Field

Hello all,

I have a lotusscript running on a form that if field1 is not in field2(which is on another form) add it. But I am having trouble appending to the multi valued text field(field2). Type mismatch is the error message. I have to use NotesDocument because I have to search based off of the username, so I can’t use the NotesUIDocument with the FieldAppendText function.

Here is the code:

NotesDocument.field2 = NotesDocument.field2 + Chr(10) + Chr(13) + field1

Thanks in Advance

Subject: Adding to Multi Valued Text Field

To add a new value to a multi-value text field:

Dim item As NotesItem

Set item = docA.GetFirstItem(“field2”)

Call item.AppendToTextList(docB.field1(0))

BTW, you can’t use "Call item.AppendToTextList(docB.field1), because regardless of actual content, a field is considered to be an array and AppendToTextList only adds a single text value, not an array of values.

Subject: Adding to Multi Valued Text Field

Try using AppendToTextList.