Comparing names field

please help me how to do the script in querysave about comparing strings with a names-type field. here’s my initial script:

finalreviewer = “,Girlie D Berou/ISD/PAL”

If note.ReviewerList(0) <> “” Then

Call source.FieldAppendText(“ReviewerList”,

      finalreviewer)

End If

How would this script look like if i want to append finalreviewer to ReviewerList field if ReviewerList does not contain finalreviewer. provided that ReviewerList field is in Names type.

please help…

Subject: RE: comparing names field

finalreviewer = "CN=Girlie D Berou/OU=ISD/O=PAL"If isnull(ArrayGetIndex(note.ReviewerList, finalreviewer)) then

note.getfirstitem(“ReviewerList”).AppendToTextList(finalreviewer)

End If

Subject: RE: comparing names field

thanks! i did some adjustments on the script though…

but thanks!

Subject: RE: comparing names field

this script is great. but what if i don’t want to append finalreviewer to ReviewList if ReviewList is empty?

please help…thanks

Subject: RE: comparing names field

If note.ReviewerList(0) <> “” then… so on

End If

We’re assuming that the field doesn’t contain multivalues with the first value blank. That’s a safe assumption unless you’re doing something that would cause that, since blank values are removed from form fields during editing/saving.

Subject: RE: comparing names field

this works but yes, the field does contain multivalues…so i used below:

If source.Document.HasItem(“ReviewerList”) Then

If source.Document.GetItemValue (“ReviewerList”)(0) = “” Then

…so on

End if

End if

its working well now…thanks a lot Andre!