Hi,
I need a script to remove 2 values from a multivalue field from all the documents in the database using Lotus Script. Suppose multivalue field named as “subject”, this field contains various values in various documents.
My requirement is, if “subject” field contains values either X and Y, or X , or Y only… then I want to remove these values from all the documents.
If it is possible pls provide complete script.
ADV Tks.
Subject: Use @Formula agent
SELECT Subject=“X”:“Y”;
FIELD Subject:=@Trim(@Replace(Subject;“X”:“Y”;“”))
Run the agent on all the documents.
Subject: Multivalue field - remove some values using LS
Try something with this:
Sub RemoveItemValueStr(item As NotesItem, value As String)
Dim strArray() As String
Dim i As Integer
i = 0
Forall v In item.Values
v = Cstr(v)
If v <> "" Then
If v <> Cstr(value) Then
Redim Preserve strArray(i)
strArray(i) = v
i = i + 1
End If
End If
End Forall
item.Values = strArray
End Sub