question

gogi100 avatar image
0 Votes"
gogi100 asked MichaelHan-MSFT answered

sharepoint 2010 multiple values in hyperlink field programmatically

i have a event reveiver the itemupdated.how i add multiple values in hyperlink field. the part of my code is

 string idponudesmestajZ = properties.ListItem["ID ПонудеСмештајЗ"] == null ? "" : properties.ListItem["ID ПонудеСмештајЗ"].ToString();
 string sFileName = "document.docx"
 SPList PonudeSmestajZbirno = web.Lists["Понуде - смештај (збирно)"];
 SPList Sektor1Dokumenta = web.Lists["Сектор 1 - Документа"];
 SPFolder folder = Sektor1Dokumenta.RootFolder;
                                         SPFileCollection fcol = folder.Files;
                                         string link = web.Url + "/" + fcol.Folder.Url + "/" + sFilename;
                                         SPFieldUrlValue urlValue = new SPFieldUrlValue();
                                         urlValue.Description = sFilename;
                                         urlValue.Url = link;
                                         SPQuery upit = new SPQuery();
                                         upit.Query = "<Where><Eq>" + "<FieldRef Name='ID' />" + "<Value Type='Text'>" + idponudesmestajZ + "</Value>" + "</Eq>" + "</Where>";
                                         SPListItemCollection kolekcijaponudesmestajzbirno = PonudeSmestajZbirno.GetItems(upit);
                                         foreach (SPListItem ponuda in kolekcijaponudesmestajzbirno)
                                         {
                                             if(ponuda["Линк"] == "")
                                             {
                                             ponuda["Линк"] = urlValue;
                                             ponuda.Update();
                                             }else if (!(ponuda["Линк"] == ""))
                                             {
                                                //i don't know what i type here
                                                   
                                                                                           
                                             }
                                         }



sharepoint-devoffice-sharepoint-server-developmentoffice-sharepoint-server-customization
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @gogi100,

No, it's not possible. In SharePoint, hyperlink field doesn't support multiple values.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.