0

I can get a reference to my SPFieldMultiColumn

 var documentLinkFieldValue = listItems[i]["DocumentLink"] as SPFieldMultiColumnValue;
 var oField = listItems[i].Fields["Document Link"] as SPFieldMultiColumn;

I am making a change to the field value but I am struggling to update the field with the new value

                              if (documentLinkFieldValue != null)
                              {
                                  var link = documentLinkFieldValue[1].Replace("##", "&");
                                  NameValueCollection nvc = HttpUtility.ParseQueryString(link);
                                  if (nvc.Count >= 3)
                                  {
                                      var server = nvc[0] as string;
                                      var db = nvc[1] as string;
                                      var docNum = nvc[2] as string;

                                      var newLink = GetIwsLink(server, db, docNum);

   // Value does not get updated
                                      documentLinkFieldValue[1] = newLink;


                                      listItems[i]["DocumentLink"] = documentLinkFieldValue;
                                      listItems[i].SystemUpdate();
                                  }
                              }

How can I save the value back to the list item?

1 Answer 1

0

I have found that this code allows me to update

 oField.ParseAndSetValue(listItems[i], documentLinkFieldValue.ToString());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.