sharepoint 2010 multiple values in hyperlink field programmatically

gogi100 51 Reputation points
2021-08-26T19:09:24.007+00:00

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 Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,273 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,767 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,591 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,021 Reputation points
    2021-08-27T01:52:42.787+00:00

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful