You are viewing limited content. For full access, please sign in.

Question

Question

Using RA and FieldValueCollection to update multi-valued fields

SDK
asked on January 30, 2014

I am using RA.  I have a situation where I populate a FieldValueCollection object with mutliple values for a multi-valued field on a document.  Only the first item in the field gets updated.  If I look at the FieldValueCollection just prior to calling docInfo.SetFieldValues(myfielldValueCollection), I notice that despite having added many items with the same field name to the FieldValueCollection object, it contains just one reference to the multi-valued field.

 

How do I update multi-valued field values using RA?  Any ideas?
 

 

0 0

Replies

replied on January 30, 2014

Michael,

 

If I am following correctly you are asking how to store a multivalued field to the FieldValuesCollection.  If that is the case then you store the multiple values to an array and then use the FieldValuesCollection.Add(fieldName, array) method to actually add the multivalued field.

 

Here is a code snippet

 

            Dim fvCollection As New FieldValueCollection
            Dim multiValues(4) As String

            multiValues(0) = "This is item 1"
            multiValues(1) = "This is item 2"
            multiValues(2) = "This is item 3"
            multiValues(3) = "This is item 4"

            fvCollection.Add("MultiTest", multiValues)

            docInfo.SetFieldValues(fvCollection)
            docInfo.Save()

 

If I didn't understand the question then let me know wink

4 0
replied on January 30, 2014

That sounds like the perfect solution.  Thanks!  I'll try it.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.